Hunter Pence had an RBI single in his debut for the Phillies after he was acquired from the Houston Astros Friday night for three minor leaguers.
Cliff Lee (10-7) struck out 11 to reach double digits for the 16th time in his 10-year career, including seven this season. He allowed four runs on eight hits and walked two in 7 2-3 innings.
Ryan Madson pitched a scoreless ninth, striking out the side, for his 17th save in 18 chances.
James McDonald (7-5) gave up five runs on 10 hits while striking out five and walking two.
Pedro Alvarez homered for the Pirates.
Pence wore No. 3, started in right field and batted fifth behind Howard. He was greeted with a standing ovation when he took the field in the first inning and when he batted for the first time in second. He hit .309 with 11 homers and 62 RBIs in 99 games with the Astros and was a much-coveted right-handed bat the Phillies wanted in part to protect Howard.
Howard made the move look good and he had a shot at the cycle, needing only a triple, when he drove the ball to deep center in the sixth. The ball caromed off the glove of Andrew McCutchen just in front of the wall in center, but the center fielder quickly retrieved it and held Howard to his second double of the game.
Howard led off the second with a solo shot to deep center to give Philadelphia a 1-0 lead, snapping McDonald's 12 2-3 scoreless streak.
Jimmy Rollins put the Phillies ahead 2-0 with a solo homer to right in the third and, three batters later, Howard made it 3-0 with a double off the wall in left that scored Shane Victorino. It was the 1,000th hit of Howard's career.
Alvarez brought Pittsburgh within 3-2 with his two-out, two-run shot to right in the fourth.
But the Phillies got both runs back in the bottom of the frame. Lee scored when right fielder Steve Pearce misplayed Chase Utley's single to right, and Rollins reached on Howard's RBI single to right.
Philadelphia tacked on a run in the seventh on Carlos Ruiz's RBI double to left-center that scored Placido Polanco and made it 6-2.
The Pirates got two runs back in the eighth on RBI singles by Walker and Brandon Wood. Pittsburgh had the tying run on with two outs, but Antonio Bastardo struck out Alvarez in relief of Lee to end the threat.
Pence's first hit as a Phillie, a solid single to center in the eighth off Jose Veras, scored Victorino and made it 7-4 Philadelphia.
Pence grounded out in his first at-bat, although replays appeared to show he beat shortstop Walker's throw to first on a grounder up the middle. First-base umpire Angel Hernandez, however, called Pence out, prompting Phillies manager Charlie Manuel to come out to argue and Pence to pull his helmet off in apparent disbelief.
In his second at-bat, Pence flied out to short right field with runners on second and third and one out. Pence grounded into a fielder's choice in his third at-bat, and hit an inning-ending groundout to short in sixth in his fourth at-bat.
As a result of the Pence trade, the Phillies optioned promising outfielder Domonic Brown to Triple-A Lehigh Valley. Brown batted .246 with five home runs and 19 RBIs in 54 games for the Phillies this season.
NOTES: Along with Brown, the Phillies optioned right-hander Andrew Carpenter to Triple-A, and activated third baseman Polanco from the disabled list. Polanco had been sidelined since July 5 with a back injury. Lee's two hits gave him 11 for the season, leading all Philadelphia pitchers. The crowd of 45,737 was the Phillies' 181st consecutive sellout. Pittsburgh's Michael McKenry went 0 for 4 with four strikeouts, snapping his six-game hitting streak.