The right-hander, supported by three double plays, pitched 7 1/3 strong innings to help the Indians beat the Baltimore Orioles 3-1 on Monday night and avoid a four-game sweep.
Masterson (7-8) struck out six and gave up one run as Cleveland snapped a four-game losing streak. Chris Perez pitched the ninth for his 27th save in 29 chances.
"Masterson did a tremendous job," Indians manager Manny Acta said. "He did what you expect a number one guy to do, go out and shut down the opposition."
A year ago, eight of Masterson's 12 wins came after losses. This was only the second time this season he won after a loss, however.
It couldn't have come at a better time. Cleveland opens a key three-game home series Tuesday night against AL Central leader Detroit. The Indians trail the Tigers by four games.
"You always want to take that opportunity when it is there," Masterson said of ending losing streaks. "Just give me two (runs) boys, and we'll try to get it done."
Shin-Soo Choo did that, putting the Indians ahead 2-0 with a two-run homer in the third inning off Tommy Hunter (4-5). It was the 10th homer allowed by Hunter in his last seven starts and 20th this season.
The Orioles twice made poor baseruning decisions as they had a five-game winning streak stopped.
"Those were the keys to the game," said shortstop Asdrubal Cabrera, involved in both of those plays as well as all the Indians' three double plays.
Baltimore scored with two outs in the fifth. Masterson hit Ryan Flaherty in the left foot with a pitch. Omar Quintanilla followed with an RBI double -- his first hit since being acquired from the New York Mets on Saturday.
Quintanilla made his first start as manager Buck Showalter gave shortstop J.J. Hardy a rest. Hardy had a cortisone shot in his sore right shoulder before the All-Star break.
Baltimore ran amok in the second and eighth.
Adam Jones doubled to open the second. After Matt Wieters struck out, Jones strayed off second on a ball hit back to Masterson by Wilson Betemit and was caught in a rundown. The Indians threw the ball around like a hot potato, but eventually got Jones. It was scored 1-5-6-5-4-6. Not your everyday fielder's choice.
"We made way too many throws," Cabrera said, "But we got the out. That's all that matters."
"When he hit that, my heart sank," Pestano said. "I knew how important this win was for us. My heart was hurting until they messed up."
Markakis hustled around third as left fielder Aaron Cunningham got the ball and threw to shortstop Cabrera. Markakis appeared determined to score when third-base coach DeMarlo Hale suddenly gave a hand signal to stop.
Markakis did -- halfway between third and home. By then, catcher Carlos Santana had Cabrera's relay throw in his mitt. He tossed to third baseman Jack Hannahan, who applied the tag to Markakis, who hung his head as he trotted to the Orioles' dugout.
"It was 99.9 percent my fault," Markakis said. "I should have picked up my third-base coach and by the time I saw him I didn't see him do anything so I was using my own judgment. I thought I was going to get there. I heard him as I was going past the bag.
"I stopped and froze. I should have kept going," he said. "I should have made them make two good throws and get me out. It didn't end up good. It was bad baserunning on my part."
Chavez reached third on the play, but Pestano struck out Jim Thome to end the threat.
Indians OF Grady Sizemore, out since having back surgery in March, remains optimistic he will play this season, but says his progress hit a snag a month ago, when he felt better. "I don't know what OK feels like," said Sizemore, who had surgery on both knees in 2011. "I can't rehab my back fully because of the knees and can't rehab my knees because of the back." Sizemore takes batting practice and throws, but cannot run full speed. ... Acta said he liked how RHP Roberto Hernandez threw during a bullpen session. Hernandez made 30 pitches, utilizing fastballs, sinkers and sliders and likely will start a rehab assignment in the minors Thursday. ... Orioles RHP Stu Pomeranz (sore back) will be re-evaluated by doctors Tuesday. He went to the DL with an oblique injury, then hurt his back while rehabbing. ... Orioles 2B Brian Roberts (hip injury) continues baseball activities in Sarasota, Fla. but there's no timetable for his return. ... Masterson is 5-2 over his last eight starts.