Astros closer Mark Melancon couldn't make it through a third inning unscathed.
Melancon, who cruised through his first two innings Sunday, was unable to handle a grounder toward first with one out in the 11th, and things got worse from there for Houston.
Pinch-runner Josh Harrison scored on a passed ball for the first of Pittsburgh's three runs in the 11th and rookie Alex Presley drove in his third run of the game later in the inning to lead the Pirates to a 7-5 win over the mistake-prone Astros.
Melancon said he rushed the play and looked up to see where first baseman Carlos Lee was.
"I make that routine play at first base, they have a guy on second with two outs," Melancon said. "Looking back, it seems like three or four things went wrong. It seems like that sums up our season a little bit. It's a game of inches, and we never get those inches. That's on us. It's not the way that luck falls, it's on us, but it's tough."
Melancon gave up three runs — one earned — and two hits in 2 1-3 innings, his longest outing of the year.
"(Pitching coach Doug) Brocail asked me if I was all right, and I said: 'Yeah, I felt good,'" Melancon said. "I was pitching well. I felt like I had it in me to go one more. Looking back, you can say whatever, but I felt good out there."
Pittsburgh closer Joel Hanrahan allowed an RBI double to Chris Johnson that tied it 4-all in the eighth, the All-Star's first blown save of the season. That broke a streak of 28 straight saves dating back to last year.
"I was glad I got a ball in the gap and got a guy in to score," Johnson said. "He's pretty good ... you're just battling against him. I got him 3-2, and he left one over the plate, and I put it in the gap."
Hanrahan pitched a 1-2-3 ninth before Chris Leroux (1-0) allowed one hit in a scoreless 10th for his first major league win. Chris Resop allowed a solo homer to Quintero in the 11th, but got his first career save.
Presley had an RBI single in the fourth inning and put the Pirates on top 4-3 with his run-scoring double in the sixth.
Houston manager Brad Mills was ejected for arguing balls and strikes on an at-bat by Jeff Keppinger in the third inning. Keppinger, who finished a triple short of the cycle, homered for the second straight day when he launched a two-run shot that gave Houston a 3-2 lead two pitches later.
Clint Barmes singled with two outs before Keppinger's homer. Mills was tossed as he walked out of the dugout during Keppinger's at-bat. He trotted onto the field after he was ejected and spent a couple of minutes arguing with plate umpire Eric Cooper before leaving.
"There were some pitches that looked pretty good that Wandy (Rodriguez) was throwing from my angle, which isn't the best angle in the world," Mills said of his fifth ejection this season. "I understand that it was early in the game, and maybe his strike zone hadn't been established yet, but at that point, I thought that Wandy was making some pretty good pitches, and he hadn't been rewarded. I voiced my opinion probably a little too strongly."
Rodriguez allowed eight hits and four runs while matching a career high with 11 strikeouts in 5 2-3 innings, but it was a two-run double to Pittsburgh starter Kevin Correia in the second that Rodriguez regretted.
"I felt great," Rodriguez said. "I think my biggest mistake today was when the pitcher was hitting. I got behind in the count, and I tried to make a good pitch, and he hit the pitch very well. I had 11 strikeouts because I had good command over my pitches. My breaking ball and fastball had great location."
Correia yielded five hits and three runs in six innings.
NOTES: The Astros placed INF Matt Downs on the paternity leave list and purchased the contract of LHP Wesley Wright from Triple-A Oklahoma City after the game. ... Lee was shaken up in a collision with Andrew McCutchen in the 11th. Lee was jumping to grab a high throw to first when McCutchen crashed into him, sending Lee face down to the dirt. He remained there for a couple of minutes and was checked out by trainers before getting up and remaining in the game. Mills said Lee was OK.