"We got it done, but it was kind of hard to watch," Phillies manager Charlie Manuel said.
Pettibone (4-3) tossed 5 2/3 innings and surrendered one run on three hits.
Pettibone was pretty good," Manuel stated. "It was hot and he kind of ran out of steam, but he was pretty good. He did his job, he did fine."
Pettibone got out of a couple of big jams to notch his first victory since May 14 against Cleveland.
"I think a few innings were a little tougher than the others," Pettibone said. "I think in the middle of the game I kind of got in a little streak, which quieted the pitch count a little and let me get through at least five or six, but the first and the last innings were definitely a battle."
Pirates right-hander Brandon Cumpton (0-1) also hurled 5 2/3 innings, and he allowed three runs on six hits to get the loss.
The Phillies broke through in the sixth inning. Michael Young singled with one out, and he was erased on a fielder's choice, putting Chase Utley on first. Jimmy Rollins singled, putting runners at first and second.
Ryan Howard snapped an 0-for-22 slump with an RBI single to score Utley. Domonic Brown hit a sacrifice fly, plating Rollins. Delmon Young then stroked an RBI double, knocking in Howard and giving the Phillies a 3-0 lead.
"Howard got a huge hit, a big hit," Manuel said.
"It felt good to get out there and get a knock," Howard said. "Put the team up and get the other one as well, stretched out scoring from first. It felt good to get out there and run around a little bit."
The Pirates nicked Pettibone for a run in the bottom of the sixth inning on a solo home run by Garrett Jones. Pettibone gave way to lefty Jake Diekman, who got the final out of the inning.
Jones gave a tip of the cap to Pettibone for his effort.
"He hit his spots well," Jones said. "Hit the corners when he needed to. Mixing in his four-seamer with his two-seamer.
"He's got a good arm, sneaky fastball. When he rears back, he's not a bad pitcher. So today he just hit his spots and we just couldn't get anything going."
The Phillies' leaky bullpen preserved the win, as right-hander Phillippe Aumont pitched a scoreless seventh inning. Then the Phillies mixed and matched J.C. Ramirez, Antonio Bastardo, Justin De Fratus and Jonathan Papelbon, who pitched a scoreless ninth inning to notch his 16th save.
The game was on the line in the bottom of the eighth inning when the Pirates loaded the bases with two outs. De Fratus, who has been tagged with three of the bullpen's seven losses since June 7, came on to strikeout Jordy Mercer and end the the threat.
De Fratus was happy to get the job done.
"Honestly, I've already failed enough, I'm going to get this one done," De Fratus said. "All joking aside, it was a chance to redeem yourself and get it done."
Pettibone was pleased that the beleaguered bullpen got the job done.
"It was great," Pettibone said. "They picked me up big time tonight from the sixth inning on. Maybe the last couple of games haven't gone their way, so it was good for them to kind of get back on track."
The win gave the Phillies a road record of 21-26, but it wasn't pretty.
"We didn't play fundamental baseball," Manuel said. "That's the consistency part that comes in. It was a good game to watch, but at the same time, it was a tough one."