PITTSBURGH (KDKA/AP) — Andrew McCutchen helped lead the Pirates to a 5-4 win over the Houston Astros on Wednesday.

The Pirates (66-77) edged out the Astros to win the three game home series.

Houston took an early lead after scoring three runs in the first inning. Carlos Lee and Matt Downs hit back-to-back home runs.

In the bottom of the first, McCutchen hit his first homer of the night.

Clint Barnes’ homered in the fourth to make it 4-1. Then, McCutchen’s fifth inning three run home run tied it.

Jason Jaramillo’s RBI single in the eighth gave the Pirates their fifth run.

The Pirates’ bullpen combined for 5 2-3 innings of scoreless relief, with Tony Watson (2-2) getting the final out in the eighth and Joel Hanrahan working a perfect ninth for his 36th save in 39 opportunities.

Making his third start since a three-week stint in the minors during August, J.A. Happ gave up four runs on five hits and four walks in five innings. He tied a season high with eight strikeouts.

Happ had allowed one earned run in his two previous starts since bring promoted back to the majors. He also hadn’t allowed more than three runs in any of his previous seven career starts against Pittsburgh.

Making his second start since being promoted from Triple-A, Brian Burres allowed four runs on seven hits in 3 2-3 innings.