James McDonald didn't complain or make excuses. He did his part to end Pittsburgh's slide.

The Pirates, though, couldn't give him one run.

Justin Masterson blanked Pittsburgh for seven innings, working out of jams three times, and the Cleveland Indians snapped a three-game losing streak with a 2-0 win Friday night over the Pirates, who dropped their fourth straight and were shut out for the sixth time.

"Sometimes you give up six (runs) and get a win," said McDonald, whose only losses have come in shutouts. "I did everything I could, my teammates played well behind me and did all I could ask."

McDonald (5-3) matched Masterson for six innings, only giving up an RBI double to Carlos Santana in the third, a cue shot by Cleveland's catcher that hugged the third-base line. McDonald allowed one run and three hits in six innings, but lost for just the second time in his last seven decisions.

"His best two innings were the last two," Pirates manager Clint Hurdle said. "He did a nice job. James is hard to hit, especially when he gets the downward angle on his pitches. He did his job, we just didn't get our hits when we needed to get them."

The Pirates had their chances, but couldn't come up with a clutch hit and dropped to 3-19 in AL ballparks the last three years in interleague play.

"We didn't hit when we had opportunities," said center fielder Andrew McCutchen, who went 0 for 3 with a walk. "The good teams do little things to win. We didn't tonight. It was a tough loss for J-Mac because he pitched really well and deserved a win."

Masterson (3-6) allowed four hits, struck out nine and ended his own three-game slide. The Pirates had him in trouble in the fourth, sixth and seventh innings, but the right-hander was able to wriggle out of the threats and got a huge defensive play from second baseman Jason Kipnis in the sixth.

Vinnie Pestano worked the eighth and Chris Perez pitched the ninth for his major league-leading 21st save as the Indians bounced back after being swept in a series at Cincinnati. Perez, who always seems to make it interesting, gave up a leadoff single to Casey McGehee before getting a fly ball and retiring Jose Tabata on a game-ending double play.

Hurdle said his young hitters tried to do too much against Masterson, expanding the strike zone when they had him on the ropes.

"Who's in trouble there?" he said. "We need to have a better understanding and awareness when we're in the (batter's) box. We worked outside our comfort zone. It is like, 'I've got a chance to be a hero here.' It has to be that you can be the guy if you get a good pitch and then hit it."

Cleveland's Michael Brantley extended baseball's longest hitting streak this season to 22 games with an RBI single in the eighth.

Masterson hadn't won since May 24, when he beat reigning AL MVP and Cy Young Award winner Justin Verlander 2-1. Masterson had dropped his previous three outings despite pitching well in two of them. He lost 2-0 in St. Louis in his last start, when he gave up one run in seven innings.

The right-hander had the Pirates flailing at a wicked slider that slid across the plate and out of the strike zone. During one stretch from the second through fourth innings, he recorded seven consecutive outs with strikeouts.

"He was terrific," Indians manager Manny Acta said. "He had the best slider I've seen this year."

For whatever reason, the Indians' offense struggles when Masterson is on the mound. He has received two or fewer runs in eight straight starts and 11 of 14 this season.

"Trust me, the offense is very well aware of that as I'm sure he is too," Kipnis said. "We want to give him all the runs that he deserves. But after that series we just had in Cincinnati, for him to come out and give us that kind of start was tremendous."

Masterson got into trouble in the fourth when the Pirates loaded the bases on a pair of walks and a single. But the 6-foot-6 Masterson struck out Tabata on one of those filthy sliders to end the threat.

In the sixth, he gave up a leadoff ground-rule double to Neil Walker, who advanced to third on McCutchen's groundout. Garrett Jones hit a soft fly to shallow right that Kipnis ran down with an over-the-shoulder catch. He then spun around and fired a one-hop throw to the plate to keep Walker at third.

Masterson retired McGehee on a grounder to Kipnis to end the inning.

"It was a phenomenal play," Brantley said of Kipnis' effort. "That was a big momentum shift right there."

The Indians used a little luck to take a 1-0 lead in the third on Santana's perfectly placed double.

Asdrubal Cabrera walked with one out, and with two down, he broke for second on a 3-2 pitch that Santana sliced down the line, the ball barely skipping inside the bag and curling toward the tarp. Cabrera never slowed and scored without a throw as Santana scampered into second.

Brantley's single in the eighth off Juan Cruz made it 2-0. Brantley's hitting streak is the majors' longest since Atlanta's Dan Uggla hit in 33 in a row last season.

NOTES: The Pirates are 15-16 against the Indians. .... Hurdle gave Indians RHP Ubaldo Jimenez a warm hug during batting practice. Hurdle was Jimenez's manager in Colorado from 2006-09. ... McDonald also has had poor run support. The Pirates have scored one or no runs in seven of his starts. He's 0-3 with a 2.06 ERA in those games. ... The Pirates have been outscored 8-0 in McDonald's three losses.