SAN FRANCISCO -- Eric Stolts overcame an early home run by Hunter Pence to record his third consecutive win as the San Diego Padres, using a four-run fourth inning, rallied to beat the San Francisco Giants 9-3 on Saturday afternoon.
The Padres broke open a tight game with a four-run ninth inning that included Jedd Gyorko's 22nd home run of the season, a two-run shot off Giants left-hander Mike Kickham. Only two rookie second basemen have hit more homers.
The win assured the Padres will finish no worse than tied for third place in the final National League West standings. San Diego (76-85) leads San Francisco (75-86) by one game with just Sunday's series finale remaining.
Stolts (11-13), who had been 0-6 since the All-Star break before his three-game win streak, surrendered a run in the San Francisco first on a pair of doubles, then fell behind 3-1 on Pence's two-run shot in the third, his 27th of the season.
Pence had more than just the home run to celebrate Saturday. Before the game, he signed a five-year contract worth $90 million. The right fielder had been scheduled to become a free agent after Sunday's finale.
Stolts allowed three runs on seven hits in seven innings. The left-hander retired the last nine batters he faced, finishing with no walks and three strikeouts.
Luke Gregerson and Nick Vincent shut out the Giants on two hits over the final two innings.
The win was just the Padres' second in eight games at AT&T Park this season.
Chris Denorfia led off the game with a home run, his 10th of the season, but the Padres did their most significant damage in the fourth.
Previously unbeaten Yusmeiro Petit (4-1) retired all 11 Padres he faced after Denorfia's homer until Chase Headley doubled with two outs in the fourth.
That set up the most critical at-bat of the game, a 14-pitch duel between Petit and the Padres' Tommy Medica. The rookie first baseman won the battle, smacking Petit's 14th pitch into center field for an RBI single that got the Padres within one, 3-2.
Petit was never the same. Four pitches later, Jesus Guzman gave the Padres a lead they would never relinquish with a two-run homer to left field.
Alexi Amarista, Chris Robinson and Stults followed in quick fashion with singles, the pitcher's hit driving in Amarista to cap the four-run inning and end Petit's afternoon.
Petit, who gave up just 12 runs in his first six starts of the season, surrendered five runs on seven hits in 3 2/3 innings Saturday. He struck out two and did not walk a batter.
Angel Pagan, who doubled to lead off the Giants' first and scored the club's first run, had three of San Francisco's nine hits.
Five relievers held the Padres scoreless on three hits through the eighth inning before San Diego's four-run explosion. Denorfia had his second RBI of the game with a single in the six-hit uprising, while Medica and Guzman capped three-hit efforts with two-out singles.
The Padres finished with 16 hits. All nine starters had at least one hit.
NOTES: The only second basemen to hit more than 22 home runs as rookies were Florida's Dan Uggla (27) in 2006 and the New York Yankees' Joe Gordon (25) in 1938. ... Padres OF Will Venable, who did not start because of a strained left abdominal muscle, pinch-hit in the ninth and ignited the four-run inning with a double. He immediately left the game for a pinch-runner. ... The win was San Diego's 76th of the year, matching last season's total. ... Both teams entered the game 15-10 in September, tied for the third-best mark in the NL. ... Pence will become the only major-leaguer to start all 162 games this season if he, as expected, starts Sunday's finale.