PHILADELPHIA -- Carlos Quentin talked like a modest rookie, saying he would do anything to help Arizona win.
On Tuesday night, his contribution was the winning home run in extra innings.
"I just happened to put a good swing on it," Quentin said.
Quentin hit his third homer of the season leading off the inning against Ryan Franklin (1-5), the seventh Phillies pitcher. The Phillies walked 11 batters and starter Ryan Madson tied a major league record with four wild pitches in one inning.
Ramon Pena (1-0) pitched two scoreless innings to earn his first major league win.
Chase Utley hit two homers and extended his hitting streak to 25 games for the Phillies. His second homer of the game tied the score in the ninth inning and bailed out All-Star closer Tom Gordon, who allowed an inherited runner to score the tying run in the eighth and then gave up a go-ahead, unearned run in the ninth.
Quentin stole second after Gordon relieved Arthur Rhodes with two outs in the eighth. Jeff DaVanon's pinch-hit triple to left tied the score at 4. Gordon then walked the next two batters to load the bases before retiring Luis Gonzalez on a grounder.
But Gordon couldn't escape a second bases loaded jam in the ninth. Chad Tracy walked to open the inning and Johnny Estrada singled. Shawn Green lined a one-hopper off second baseman Utley's glove to load the bases.
Quentin hit a grounder to David Bell, but the third baseman stumbled as he threw home and his throw pulled Mike Lieberthal off the plate, making it 5-4. Bell was charged with an error.
"The last couple of outings it seems like I've been forcing the ball," Gordon said. "I haven't been able to get my breaking ball down."
Gonzalez added a solo homer for the Diamondbacks, who opened a 10-game road trip 1½ games behind San Diego in the NL West.
"If you wait a few days and blink your eyes, it could flip," manager Bob Melvin said. "It's going to go down to the wire in this division."
Quentin, Arizona's second pick in the first round of the 2003 draft and the 29th overall selection, is 5-for-14 with three homers and seven RBI in five games since he was called up last week.
"I'll do anything I can do to help this team win," he said. "He left one over the plate and I put a pretty good swing on it."
The Diamondbacks could only score one run against Madson in the third inning when the right-hander ran into trouble throwing the ball into Lieberthal's mitt.
Madson became the first National Leaguer to throw four wild pitches in an inning since Atlanta's Phil Niekro in 1979. At least he had the knuckleball as an excuse.
Madson allowed a leadoff double in the third inning to Gonzalez, who scored after the right-hander threw two wild pitches to cut the lead to 3-2. Tracy followed with a single and also advanced two bases on two wild pitches, but was left stranded.
Walter Johnson threw four wild pitches in one inning for Washington in 1914 and Anaheim's Kevin Gregg was the last to do it in 2004, according to the Elias Sports Bureau.
Madson has 10 wild pitches this season. Arizona's Miguel Batista, who started against Madson, threw one in six innings and leads the league with 12.
The Phillies record for a game was five wild pitches set by Ken Howell on April 5, 1989, at Chicago. Madson didn't get a chance to tie that mark in his four-plus innings. He was pulled after loading the bases in the fifth inning and failing to retire a batter.
"Madson didn't have his command," Phillies manager Charlie Manuel said.
But Aaron Fultz bailed Madson out of the jam. The left-hander got they lefty Green to strike out, then coaxed Quentin into a groundball double play to end the threat.
Coming off his first shutout in two years, Batista failed in his bid to win his fourth straight decision. He allowed four runs, struck out six and walked three in six innings
Gonzalez hit his ninth homer into the front row of the right-field seats off Rheal Cormier in the eighth to make it 4-3.
Gonzalez hit his 528th career double, tying for 29th on the list with Frank Robinson and Cap Anson. ... Rick Ankiel of the St. Louis Cardinals threw five wild pitches in a division series playoff game against Atlanta in 2000. ... Utley, who had a two-run homer in the first, has nine career multihomer games, four this season. ... Jason Grimsley was the last Phillies pitcher with four wild pitches in a game on April 15, 1991. ... RF Bobby Abreu first-inning walk was the 946th of his career, tying him for second with Richie Ashburn and Mike Schmidt on the team's career list. ... Phillies LHP Randy Wolf, sidelined with ligament reconstructive surgery since last July, made his final rehabilitation for Class-A Lakewood. He will start a game in Sunday's doubleheader against Florida.