(AP) Madison Bumgarner outdueled Clayton Kershaw, and the San Francisco Giants held off the Los Angeles Dodgers for a 4-2 win on Friday night when Adrian Gonzalez's hard grounder took a fortunate hop for the final out.
With runners on first and third and two outs, Gonzalez hit the ball off Sergio Romo's leg, and the ball bounced to third baseman Joaquin Arias, who threw to first for the final out.
Hunter Pence homered and scored twice and the Giants got to Kershaw (14-9) with four consecutive singles to start the seventh.
Bumgarner (12-9) allowed two runs and five hits in six innings, extending his streak of allowing three earned runs or fewer in each of his past 18 starts. The left-hander struck out six and walked two.
Romo got the final four outs to earn his 34th save in 38 chances. He gave up consecutive singles to start the ninth, putting the tying runs on with no outs.
Yasiel Puig struck out swinging and Nick Punto hit into a fielder's choice groundout before pinch-hitter Gonzalez's ground out.
With second-place Arizona's 7-5 loss to Colorado, the Dodgers' magic number was reduced to four for clinching their first NL West title since 2009.
Kershaw gave up three runs two earned and eight hits in seven innings. The lefty who leads the majors in ERA struck out six and walked none. He had won three straight home starts against the Giants.
Kershaw has hit a rough patch lately. After giving up a season-high five earned runs and career-worst 11 hits in five innings of a 10-8 road win over Colorado on Sept. 2, he served up two solo homers to Jay Bruce over seven innings in Sunday's 3-2 loss at Cincinnati.
Pence's 22nd homer with two outs in the eighth off Chris Withrow extended the Giants' lead to 4-2.
Pence got a leadoff hit in the seventh and Pablo Sandoval followed with a single. Arias singled, scoring Pence, and Arias took second on a fielding error by Scott Van Slyke.
Brett Pill followed with a single to right, scoring Sandoval and Arias to give the Giants a 3-2 lead.
The Dodgers had the tying run on third in the seventh, but Gonzalez struck out swinging to end the inning.
Juan Uribe sent a 1-0 pitch over the left field wall to give the Dodgers a 2-0 lead in the sixth, scoring Michael Young, who singled.
Notes: Dodgers SS Hanley Ramirez sat out a day after leaving in the seventh inning with mild tightness in his left hamstring. The team said an MRI on Friday showed that Ramirez has an irritated nerve in his back rather than a hamstring issue. He received a cortisone injection and is expected to be available to play next week. Ramirez, the team's best hitter with a .342 average, has had two stints on the DL this season. ... Dodgers manager Don Mattingly said that when LHP Chris Capuano returns from a strained groin, he will initially work out of the bullpen. ... Dodgers OF Andre Ethier left the game in the eighth with an unannounced injury after doubling. ... Giants RHP Chad Gaudin, on the DL with carpal tunnel, threw 25-30 pitches to hitters in a simulated game.