Updated

The Pittsburgh Pirates are leaving Houston with their first three-game sweep of the season.

But the Pirates lost something during Thursday's win.

Garrett Jones hit a three-run homer in the first inning and the Pirates added two runs in the sixth to regain the lead and hold on for a 5-4 win over the Houston Astros.

The victory came on a day when Andrew McCutchen's career-long 14-game hitting streak ended despite his single in the sixth inning.

The Pirates learned during the game that Major League Baseball's scoring committee had unanimously ruled that a double he was credited with on Saturday against the Mets be changed to an error by the third baseman, ending what was the longest current streak in the majors.

Pittsburgh manager Clint Hurdle said he was disappointed that McCutchen's hitting streak ended that way.

But it was difficult for McCutchen to be too upset about the change with the team moving two games above .500 with the win.

It's the first time the Pirates have been two games above .500 this late in a season since being 40-38 on July 2, 1999.

"We just swept the Astros," McCutchen said. "It was nice to sweep them, felt real good about the sweep. We haven't done that all season. I don't think they can overturn us winning, so that's cool. That's something that they can't protest."

Houston scored two runs in the fourth inning before an RBI single by Hunter Pence tied it 3-3 in the fifth.

A fielding error by center fielder Michael Bourn allowed the Pirates to score a run to get back on top in the sixth before Josh Harrison doubled in an insurance run to make it 5-3.

"It was hit right at me," Bourn said. "I dove for it, but the ball went the other way, and it hit off the side of my glove. That was pretty much the game."

Pittsburgh starter James McDonald (5-4) allowed seven hits and three runs in 5 2-3 innings. He had a chance to lead the Pirates to a sweep against Philadelphia earlier this month, but allowed three runs and walked five in four-plus innings in the loss.

"It was big because the last time I had a chance for the series sweep in Philly, I didn't perform to my ability," he said of Thursday's win. "I felt like I competed, kept us in the game. I didn't feel like I had good command."

Tony Watson walked one in two scoreless innings before Tim Wood got one out. Jose Veras allowed two hits and a run in the ninth for his first save since September 2007.

Pence had three hits for the Astros, who have dropped 11 of their past 13.

Houston rookie Jordan Lyles (0-2) remains winless in four starts after allowing four hits and three earned runs with a career-high eight strikeouts in 5 2-3 innings.

"Hopefully I will get some wins, I don't like to lose," he said. "They'll come down the road some time."

Jose Tabata hit a leadoff single before Lyles walked McCutchen with one out. The two-out shot by Jones that landed in the stands in right field was his seventh of the season and first since May 2.

"We've been playing really good ball, winning some series here and there, but to get a sweep here feels great," Jones said. "To play three good days of baseball and come away with three wins is definitely a confidence booster."

Lyles got on track after the homer, retiring the next 15 batters and striking out six of them, including the side in the fifth inning. He didn't allow another hit until McCutchen singled to center field with two outs in the sixth.

Neil Walker singled after McCutchen's hit to chase Lyles, who was replaced by Sergio Escalona.

Jones reached on an error by Bourn when the ball bounced off his glove, allowing McCutchen to score and put Pittsburgh up 4-3.

Josh Harrison's double scored Walker and pushed the lead to 5-3. Jones was thrown out at home on the play to end the inning.

Brett Wallace walked before Matt Downs doubled in the fourth inning. Wallace scored on a groundout by Angel Sanchez before Downs scored on a sacrifice fly by Carlos Corporan to pull Houston to 3-2.

Bourn walked with no outs in the fifth inning before scoring on Pence's 20th double of the season to tie it at 3-3 with one out. McDonald struck out Carlos Lee before intentionally walking Wallace, but he escaped the jam by retiring Downs to end the inning.

Pence was thrown out at home on a double by Lee in the third inning.

Jeff Keppinger drove in a run in the ninth to make it 5-4.

Notes: Houston C Robinson Cancel cleared waivers and accepted his assignment to Triple-A Oklahoma. ... Corporan's RBI in the fourth inning was the first of his career.

___

Kristie Rieken can be reached at http://twitter.com/kristieAP