PHOENIX -- The Diamondbacks' one-two punch came from an unlikely source Sunday.
Ojeda had two doubles and a bunt single, and scoring twice. His two-run double into the left-field corner in the seventh inning finished the scoring, and he drove in Tracy with a double in a two-run fourth inning.
Tracy, making his first start since Sept. 9, finished a triple short of the cycle. His solo homer -- upheld by replay review -- tied the game at 3 in the sixth, and Stephen Drew capped the inning with a two-out, two-run double for a 5-3 lead.
"When you get in those situations, you just hope you can contribute," said Tracy, who homered for the second straight game in what likely will be his final home game in an Arizona uniform. The Diamondbacks are not expected to exercise Tracy's $7 million option for 2010.
Arizona scored six runs with two outs, and all of Ojeda's RBIs came with two outs. Ojeda has 16 RBIs, far behind team leaders Reynolds (101) and Upton (83).
"The telling tale of today's game, we couldn't finish off an inning to get a third out. They got key hits today, from some guys that are not in the middle of their order," San Diego manager Bud Black said.
Adrian Gonzalez hit his 40th home run of the season to cap a three-run third inning for a 3-0 San Diego lead.
Gonzalez became the fourth Padre to hit 40 home runs in a season, joining Greg Vaughn (50, 1998), Phil Nevin (41, 2001) and Ken Caminiti (40, 1996). He needs two more RBIs for his third straight 100-plus RBI season.
"It's a great accomplishment. It shows where he is in his career and continuing to improve on his game and become one of the premier power hitters in the National League," Black said.
Juan Gutierrez struck out Oscar Salazar with runners on first and second base in the ninth inning for his eighth save in nine opportunities. He is 7 for 7 since replacing injured Chad Qualls on Aug. 31.
Arizona (68-88) has won three of its last five games and two of its last eight series, both against San Diego.
The Padres (72-85) have lost two in a row after winning six of their previous seven. They are 15-9 in September and 34-23 since July 28, the second-best record in the NL.
David Eckstein lined a single to right field, and Gwynn scored and Eckstein took third when Upton had the ball get under his glove and roll to the fence. Upton leads major league outfielders with 12 errors.
Buckner (3-6) gave up three hits and struck out six while walking two.
Tracy's home run, his eighth of the season, was upheld after umpires used TV replays to rule out fan interference.
Tracy hit his ball toward the swimming pool area in right-center field and San Diego center fielder Gwynn leaped at the fence, trying to make the catch. The ball was clearly over the fence, but it appeared that Gwynn's glove struck a female fan who was also reaching for the ball.
Gwynn immediately protested, as did Black, but the play stood after review.
"I think my glove ended up hitting her stomach when I got full extension," Gwynn said. "After that, you really don't know what to think. No question my glove was behind the wall. I just thought she might have been in the field of play. But she wasn't. That's the call."
Gwynn handed the ball to the fan, and he said she apologized.
Gonzalez needs two more RBIs for his third straight 100-plus RBI season. ... Arizona drew 30,018 for its final home game, bringing its season attendance to 2,129,056, a drop of about 400,000 from 2008. San Diego third baseman Kevin Kouzmanoff, who has missed the last 17 games with thigh and back injuries, went through a full pregame workout Sunday. "I wouldn't be surprised if he started Tuesday," Black said. San Diego is off Monday. Kouzmanoff is second on the team with 17 homers and 84 RBIs in 137 games. San Diego left fielder Drew Macias took a hit away from Arizona third baseman Reynolds with a diving catch to end the fifth inning. Two batters later, Reynolds made a bare-handed pickup and throw to take a bunt single away from Eckstein.