LOS ANGELES — Adrian Gonzalez singled home the winning run in the 10th inning to give the Los Angeles Dodgers a 3-2 victory over the San Francisco Giants on Thursday night.
The Dodgers reduced their magic number to five for clinching their first NL West title since 2009. They won for the seventh time in eight games against the rival Giants, a stretch that began with a three-game home sweep June 24-26.
The loss ended last-place San Francisco's streak of four consecutive winning seasons.
Carl Crawford opened the 10th with a single off Jeremy Affeldt (1-5). Pinch-hitter Nick Punto sacrificed Crawford to second before Gonzalez stroked a single into center field for the Dodgers' eighth walk-off win of the season.
Brian Wilson (2-1) earned the win after pitching against his former teammates for the first time since spending seven seasons in San Francisco, where he was part of two World Series championship teams. He tossed one scoreless inning of relief.
Affeldt was activated from the disabled list before the game.
Gregor Blanco's RBI single off Dodgers closer Kenley Jansen tied the score 2-all in the ninth. Jansen allowed a leadoff single to Pablo Sandoval. He was replaced by pinch-runner Juan Perez, who stole second and advanced to third on a passed ball by catcher Tim Federowicz.
The Giants threatened in the eighth when they loaded the bases before Hunter Pence hit into an inning-ending double play.
Dodgers starter Zack Greinke allowed one run and four hits in six innings. He struck out five and walked two in his second straight no-decision.
Giants starter Matt Cain gave up two runs — one earned — and six hits in seven innings. The right-hander struck out five and walked one in his second start since coming off the disabled list after missing 14 games with a bruised right forearm.