PHOENIX (AP) - Adrian Gonzalez hit his majors-leading 18th home run and drove in three runs, and the San Diego Padres defeated the Arizona Diamondbacks 8-5 on Wednesday night for their 11th win in 12 games.

David Eckstein added three hits and an RBI as the Padres took two of three in a wild series between NL West rivals. San Diego rallied from a six-run deficit to win the opener, then nearly climbed out of a six-run hole in the second game.

On Wednesday night, San Diego opened a 5-0 lead behind Jake Peavy (5-5), then watched Arizona pull to within 5-4 before putting the game away with three runs in the eighth inning, taking advantage of four walks and two errors.

Heath Bell got the final out for his major league-leading 14th save in 14 chances.

Justin Upton had three hits, including a two-run triple, for the Diamondbacks.

Gonzalez was scratched from Tuesday night's starting lineup with the flu, although he made a late pinch-hitting appearance.

The lefty slugger appeared to be back at full strength Wednesday night. In his first at-bat, Gonzalez drove a 2-1 pitch from Billy Buckner (1-1) 10 rows into the left field seats to give the Padres an early 2-0 lead.

That looked to be enough support for Peavy, who cruised through the first five innings, allowing only two singles, both by Upton. But the Diamondbacks ambushed Peavy in the sixth.

Rookie Gerardo Parra led off with a double and took third on a single by Miguel Montero. Upton tripled to center to cut San Diego's lead to 5-2, and he scored on Stephen Drew's single.

Peavy got out of the inning with a 5-3 lead. But he was gone one out into the seventh after singles by Ryan Roberts and Augie Ojeda.

Luke Gregerson gave up a sacrifice fly to Parra to whittle the Diamondbacks' deficit to 5-4.

Peavy allowed four runs and a season-high eight hits in 6 1-3 innings, walking one and striking out five, leaving him tied with San Francisco's Tim Lincecum for the NL lead.

The Padres got three runs back in the eighth as the Diamondbacks imploded.

After Leo Rosales walked leadoff man David Eckstein, Rosales threw Scott Hairston's bunt down the right field line. That allowed Eckstein to score, and Hairston raced to third when Upton kicked the ball and was charged with an error.

Rosales walked Gonzalez intentionally, then walked Kevin Kouzmanoff to load the bases and Chase Headley to force in a run. Henry Blanco singled in a run off Esmerling Vasquez to push San Diego's lead back to 8-4.

Notes:@ Arizona has lost seven of nine series at home, including all three under new manager A.J. Hinch. The Diamondbacks fell 12½ games behind the NL West-leading Los Angeles Dodgers - the most they've trailed in the standings since finishing 42 games out in 2004. ... RHP Chad Gaudin will start on Sunday for the Padres at Colorado. ... Arizona 3B Mark Reynolds struck out three times, pushing his league-leading total to 64.

Copyright 2009 The Associated Press.