The Phillies trailed 5-3 in the eighth when Ibanez hit a two-run shot for his second homer of the game. He doubled to right off Tony Watson (0-2) in the 10th to score Hunter Pence and help the Phillies complete a three-game sweep.
Antonio Bastardo (4-0) struck out one in a scoreless inning to earn the win.
Ibanez hit a solo homer in the second off Pirates starter Jeff Karstens and his tying blast was off Jose Veras.
The Pirates, trying to keep pace in a crowded NL Central race, left Philadelphia reeling but with two new bats. A day after they traded for Derrek Lee, the Pirates acquired outfielder Ryan Ludwick from the San Diego Padres.
Pence, acquired Friday from Houston, hit a one-out double in the 10th and Ibanez followed with his 21st double of the season. The Phillies increased their lead to six games over Atlanta in the NL East and are starting to pull away.
The Pirates are fading in the division and hope Lee and Ludwick can get them back on track.
Lyle Overbay hit a two-run homer and Karstens pitched seven solid innings for the Pirates.
On the brink of losing his starting first baseman's job, Overbay connected on a two-run shot off Phillies starter Vance Worley in the sixth for a 4-3 lead. Overbay, a disappointment in his first season with the Pirates, will hit the bench once Lee joins the team. Lee, acquired from Baltimore on Saturday should take over at first when the Pirates return home.
The Pirates then got Ludwick from the Padres for a player to be named or cash considerations.
Ludwick batted .238 with a team-leading 11 home runs and 64 RBIs in 378 at-bats. He was scratched two minutes before the start of the Padres game Sunday against Colorado.
Karstens got a big boost when Overbay connected to right to put the Pirates ahead. It was one of the few times this season Overbay delivered in the clutch as the Pirates hoped when they signed him a one-year deal in the offseason.
The veteran first baseman was signed to provide Pittsburgh's offense with some much-needed pop, but he has struggled in hitter-friendly PNC Park. He entered the Philadelphia series with just one RBI since July 4, or two fewer than pitcher Kevin Correia. Overbay was batting only .217 in July and was 2 for 22 in his last eight games entering Sunday.
With Lee on the way, he was scheduled to join the team Monday, Overbay should find himself on the bench.
The Pirates open a seven-game game homestand Monday against the Cubs.
After allowing 17 runs to the Phillies in the first two games of the series, Karstens turned in a nice little outing. But the Pirates couldn't solve Ibanez.
He hit his 15th homer in the second, a solo shot, for a 1-0 lead and Jimmy Rollins singled in two runs in the fifth that gave the Phillies a 3-2 lead.
The Pirates scored another run in seventh on Garrett Jones' RBI double off reliever Brad Lidge. Xavier Paul had a two-RBI single in the fifth.
Worley, coming off his first career complete game, picked up where he left off, fanning five straight batters over the first and second innings. With his glasses and quirky mohawk, Worley has become an instant fan favorite. He struggled after his fast start, allowing seven hits and four runs in six innings.
Notes: The Pirates transferred C Ryan Doumit to the 60-day disabled list. ... The Pirates have three games left vs. the NL East. ... Ibanez had his first multi-homer game of the season