Adrian Gonzalez hit a three-run homer, Ryan Ludwick and Matt Stairs also connected and the San Diego Padres put San Francisco's potential clinching party on hold for at least a day with a dramatic 6-4 victory Friday night.
The NL West-leading Giants need one more victory to capture their first division crown and playoff berth since 2003. San Diego pulled within one game of wild card-leading Atlanta, which lost 11-5 to Philadelphia.
Clayton Richard (14-9) won for only the second time in seven starts and held down a Giants team that has hit 17 homers in its last eight games. Pinch-hitter Aaron Rowand connected for a two-run shot in the sixth to chase Richard.
Ludwick hit a towering drive over the center-field wall leading off the second against Matt Cain (13-11), who surrendered a season-high three homers.
San Diego's offense came to life after managing just five runs and 17 hits in losing three of four at home to the Chicago Cubs before coming to the Bay Area. But the Padres, who led 6-0 early, had to hold off threats in the eighth and ninth.
"Yes We Cain!" posters were handed out on a night the pitcher celebrated his 26th birthday. But he didn't have it. Cain, the longest-tenured member of the Giants, had his start pushed up to go on regular rest for the potential clincher.
Next up for the Giants is Barry Zito on Saturday afternoon. The lefty is 1-7 with a 6.50 ERA over his last 10 games, nine starts, and is 3-7 in his career against the Padres.
San Diego snapped the Giants' four-game winning streak and scored six runs for the first time in 10 games since a 6-0 road win over the Dodgers on Sept. 21.
David Eckstein scored on a wild pitch in the fifth for the Padres, who are 6-1 at AT&T Park this year. They were unfazed by a sellout crowd of 42,409 orange-clad fans waving rally towels.
Richard beat the Giants for the fourth time in six starts this season. The left-hander allowed three runs and seven hits in 5 1-3 innings.
Cody Ross doubled with two outs in the sixth against Ryan Webb, putting runners on second and third and bringing Andres Torres to the plate as the tying run. Joe Thatcher came in to face Torres, who chopped an infield single about 15 feet down the third-base line to drive in Juan Uribe and cut San Diego's lead to 6-4.
Luke Gregerson then got Freddy Sanchez to line out to center, ending the inning.
Pinch-hitter Mike Fontenot led off the eighth with a single off Gonzalez's glove at first. Ross reached two outs later on an infield hit. Manager Bud Black then turned to closer Heath Bell to face Torres and he grounded out.
Bell recorded the final four outs for his 46th save in 49 chances, his sixth in seven tries going more than one inning. With Sanchez aboard on a leadoff walk, Aubrey Huff hit a deep fly to right that Will Venable caught nearly at the wall. Sanchez took off at contact, rounded second and was doubled up. Bell walked to home and slapped hands with catcher Yorvit Torrealba. Buster Posey grounded out to end it.
The Padres won the first eight meetings between the rivals to start the season, but the Giants took three of four at Petco Park from Sept. 9-12.
Rowand had only two hits in 21 at-bats in September. This was his second career pinch-hit homer, both in 2010. He had the other July 26 against Florida.
Miguel Tejada drew a two-out, nine-pitch walk in the first before Gonzalez doubled. Tejada bolted home and came sliding in headfirst but was thrown out on a perfect sequence from right fielder Jose Guillen to second baseman Sanchez and then catcher Posey, who barely tagged Tejada.
Cain, who had won his last four decisions, was done after four innings for his second-shortest outing this year.
NOTES: Rowand homered for the first time since Aug. 11. ... The Giants are 7-30 this year when giving up six or more runs. ... Cain allowed three or more homers for just the fourth time in his career and six or more runs for the 16th time. ... Guillen had his 107th career outfield assist, 96 in RF. ... Torres, who missed only 11 games after his Sept. 12 emergency appendectomy, was chosen as this year's "Willie Mac" Award winner named for Hall of Famer Willie McCovey. ... Ross also doubled in the fifth to give him a 10-game hitting streak.