PHILADELPHIA -- Ryan Howard's tying homer in the ninth helped the Phillies complete a memorable comeback.
"That was one of the best wins of the year," Phillies manager Charlie Manuel said.
The Phillies trailed 7-3 before pinch-hitter Matt Stairs led off the ninth with a homer off Matt Capps (1-5). Jimmy Rollins walked and stole second, his third steal of the game, and Chase Utley followed with a one-out single to left.
Howard followed Utley by blasting a 1-0 pitch to tie the game at 7. Raul Ibanez, playing in his first game after missing 20 with a groin injury, then hit a ground-rule double to center. After an intentional walk to Jayson Werth and an infield single by Pedro Feliz, Bako lined a 2-2 pitch to left, sending a crowd that included Vice President Joe Biden home happy.
"We were able to go out there, put it together and pull it out," Howard said.
Tyler Walker (1-0) pitched one scoreless inning of relief.
Pittsburgh starter Ross Ohlendorf held the Phillies to five hits while allowing three runs and striking out five. The right-hander matched his career high with four walks.
"There's no excuses. It's all me," Capps said. "I stunk. That was embarrassing."
Garrett Jones, Delwyn Young and Andrew McCutchen homered and drove in two runs for Pittsburgh, which lost for the eighth time in 10 games. Ryan Doumit, playing in his second straight game after returning from a broken right wrist he got April 19, went 2 for 5 with a pair of doubles and an RBI for the Pirates. Andy LaRoche went 2 for 4 with a double and triple and Jones had a pair of hits for Pittsburgh.
Cole Hamels, the 2008 World Series MVP, lasted six innings while allowing five runs on seven hits -- all extra-base hits. The left-hander has allowed at least seven hits in six of his last seven starts and is 1/3 in that stretch.
"It was one of those things I really felt like I was able to hit my spots; unfortunately they were able to hit them," Hamels said. "Wins are the ultimate goal and to be able to come away with a win makes me feel a little better."
Jones' solo homer to deep right and Young's two-run blast to deep left-center put Pittsburgh up 3-0 after one inning. The Pirates added two more in the second on McCutchen's two-run shot to left for a 5-0 lead.
The Phillies managed just two hits through five innings before the sixth, when they scored three runs on four hits. Ibanez had an RBI double and Greg Dobbs drove in a run with a sacrifice fly.
Pittsburgh added two runs in the seventh on a single hit to make it 7-3. Jack Wilson reached on Jones' bases-loaded walk and McCutchen scored on Doumit's groundout.
Wilson, Pittsburgh's shortstop, robbed Shane Victorino of a hit with a sliding over-the-head catch and then hopping up to double off Rollins at first.
Biden sat in the first row behind the plate, wearing a Phillies cap. ... Philadelphia C Carlos Ruiz missed his second straight game with neck stiffness. ... Utley was hit by a pitch for the NL-leading 13th time this season.