In just his eighth game with the Pirates, Drew Sutton made a big impact Tuesday night.

Sutton, who was claimed off waivers from Tampa Bay on June 24, belted a solo homer to center field in the bottom of the ninth inning, boosting Pittsburgh to a dramatic 8-7 win over Houston.

The Pirates, winners in six of their last seven contests, battled back from a pair of four-run deficits and won for the 10th time in their last 12 home games.

Pittsburgh is also eight games over .500 (44-36) for the first time since 1992, when the Bucs finished 96-66, in first place in their division. That was the last time they made the playoffs, let alone finished a season with a winning record.

"Nobody cares who gets the credit. We know how hard it is. They're having a blast. They have each other's backs and it's fun to watch," Pirates manager Clint Hurdle said.

Joel Hanrahan (4-0) blew the save opportunity in the ninth when pinch-hitter Jason Castro hit a two-strike pitch for a double to the right field corner to plate Jed Lowrie.

Wesley Wright (0-2) fanned Gorkys Hernandez for the first out in the bottom of the frame, but Sutton then got hold of a 1-1 pitch and smacked his first homer of the season and fourth of his career.

"That's not usually where I hit homers," said Sutton, who received an infamous shaving cream pie to the face. "That's what good teams, do, the pitching struggles the hitting picks them up. We're playing pretty well right now, makes it fun to go to the park."

Garrett Jones continued his recent power surge by drilling a two-run homer in the seventh inning that had given the Pirates a 7-6 lead.

Andrew McCutchen legged out an infield hit with one out in the seventh. Jones, who went 4-for-5 with a homer and four RBI in an 11-2 win in the opener of this four-game series, then crushed a pitch from Brandon Lyon over the wall in right field and out of PNC Park for his 12th homer of the year.

McCutchen added a two-run homer among his three hits for the Pirates, who have gone deep in 11 straight contests, their longest streak since a 13-game run in 1994.

The late rally got A.J. Burnett off the hook for a potential loss. The right- hander, who had won his previous eight starts, allowed 12 hits and six runs over five-plus frames.

Jordan Schafer and Lowrie each had a pair of RBI for the Astros, losers of six in a row overall and eight straight on the road.

"To see these guys battle like they did tonight was pretty cool. When you play real good baseball and end up losing, you come back tomorrow," Astros manager Brad Mills said.

Lucas Harrell equaled a career-high with nine strikeouts over five-plus frames, but he gave up nine hits and five runs.

Schafer's RBI single highlighted a two-run second-inning, and Scott Moore's RBI double in the third made it 3-0. Lowrie's run-scoring single in the fourth created the first four-run margin.

McCutchen cranked a two-run homer in the bottom of the fourth, his sixth straight at-bat with a hit.

Schafer and Lowrie each knocked in a run in the sixth for a 6-2 difference, but Casey McGehee singled in Jones in the bottom of the frame. Pedro Alvarez had the Pirates within 6-5 with a two-run base hit to center field.

Game Notes

The Pirates optioned outfielder Jose Tabata to Indianapolis, recalled outfielder Gorkys Hernandez from the Triple-A club, and also agreed to terms with third baseman Julio de la Cruz...The Pirates have won four of five from Houston this season...Each team had 13 hits...McCutchen leads the majors with a .360 batting average.