PHILADELPHIA -- Wilson Valdez showed off his sparkling defensive skills before delivering a clutch hit.
Hours before the first pitch, the Phillies improved their chances at winning a fourth straight NL East title by acquiring three-time All-Star Roy Oswalt from the Houston Astros for J.A. Happ and two prospects.
Oswalt is scheduled to start for the two-time NL champions at Washington on Friday night.
After the Diamondbacks tied it in the ninth, the Phillies rallied against Esmerling Vasquez (1-4) in the 11th.
"I feel happy to help the team," said Valdez, who was filling in for the injured Jimmy Rollins. "We're doing what we have to do to win."
The Phillies closed within 2½ games of the division-leading Atlanta Braves. They have made up 4½ games in the past week.
Jose Contreras (5-3) tossed a scoreless 11th for the win. Passed over in a save situation in the ninth, closer Brad Lidge pitched a perfect 10th. Lidge threw 64 pitches and struggled while earning two straight saves earlier in the week.
"Saunders pitched great," Arizona manager Kirk Gibson said.
Kyle Kendrick allowed one run and four hits, striking out a season-high five in 6 1/3 innings. He's 1-0 with a 1.35 ERA in two starts since a brief demotion to the minors last week.
"I want to pitch here," Kendrick said.
Miguel Montero hit a solo homer for the last-place Diamondbacks, who have lost seven straight.
The Diamondbacks rallied to tie it in the ninth but blew a chance to take the lead. After Ryan Madson tossed a perfect eighth, manager Charlie Manuel kept him in instead of turning to Lidge. But Justin Upton led off with a double and J.C. Romero entered to face Adam LaRoche, who lined a single to right.
But second baseman Placido Polanco and shortstop Valdez turned an outstanding double play on Gerardo Parra's grounder to second. Valdez made a strong throw to barely beat Parra at first. Parra was ejected by first-base umpire Adrian Johnson after slamming his helmet in disgust.
It was the second time Parra hit into a double play in a clutch spot. With runners at first and third and one out in the seventh, Polanco and Valdez made an even better turn on Parra's slow bouncer.
"I tried to turn it as fast as I can," Valdez said.
Manuel said he was planning to use Lidge to finish after Romero pitched to the left-handed LaRoche if the Diamondbacks had used a right-handed pinch-hitter.
"He's our closer," Manuel said. "We definitely trust him."
Ibanez gave the Phillies a 2-0 lead in the sixth with a drive into the seats in right-center. Ibanez is batting .391 with two homers and 10 RBIs in the second half, raising his average to .263 from .243 at the All-Star break.
Ransom hit a one-out single in the fifth and scored when Ruiz lined a double into the left-field corner.
Rollins sat out his third straight game with a bruised left foot. The Phillies are also missing second baseman Chase Utley and center fielder Shane Victorino. Phillies right fielder Domonic Brown wasn't in the starting lineup a night after going 2-for-3 with two RBIs in his major league debut. Ben Francisco started instead of the left-handed hitting Brown against the lefty Saunders. Brown got a standing ovation when he pinch-hit in the seventh and flied out. ... Upton extended his hitting streak to 14 games. ... A crowd of 45,232 was the 91st straight sellout at Citizens Bank Park.