LOS ANGELES — With two strikes on him, Adrian Gonzalez kept looking for something he could hit.
He found it on the seventh pitch of his at-bat, singling 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.
It was Gonzalez’s second game-ending hit this season and the eighth of his career, helping the Dodgers win in extra innings for the second time in two days.
“I take it just like any other at-bat with runners in scoring position,” he said. “Not try to get too big on any pitch.”
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), activated from the disabled list before the game.
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.
“Carl is pretty fast,” Gonzalez said. “I knew he was going to go all the way.”
The Dodgers’ ritual celebration awaited Gonzalez, who had his jersey torn off as the crowd cheered.
“That’s one of the reasons we want home-field advantage in the playoffs,” he said.
Brian Wilson (2-1) earned his second win with the Dodgers 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.
“It’s obviously different hitting him instead of catching him, but just looking at the velocity of the cutter and the fastball, it’s pretty close to where he always is,” Giants catcher Buster Posey said.
Wilson tossed a shutout inning, and he’s thrown scoreless relief in 10 of his 11 appearances this season.
“I didn’t do anything,” he said, breezing past reporters on his way out after 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.
Jansen’s first blown save since June 29 against Philadelphia ended his streak of 18 successful conversions.
“I’m not really worried about his stuff,” Dodgers manager Don Mattingly said.
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.
Los Angeles took a 2-1 lead with two outs in the seventh. Yasiel Puig doubled to deep left-center, scoring pinch-runner Dee Gordon, who came in after A.J. Ellis hit a leadoff single. Gordon stole second and was sacrificed to third by Mark Ellis.
The Dodgers tied it at 1 on a grounder by Mark Ellis in a messy second for the Giants that included a throwing error by Cain.
“He hit the ball a little harder than I thought he did and I thought I had to jump to catch it, so that kind of changes the timing a little bit,” Cain said. “But that’s not an excuse. That’s a play that should be made.”
Greinke reached on an infield single to third after Sandoval slipped fielding the ball.
San Francisco led 1-0 on Pence’s home run leading off the second.
YANKEES 6, ORIOLES 5
BALTIMORE — The injuries keep mounting for the New York Yankees.
So do the victories.
Brendan Ryan scored the tiebreaking run in the ninth inning on a wild pitch by Jim Johnson, and New York defeated Baltimore after blowing a four-run lead.
Mark Reynolds and Curtis Granderson homered for the Yankees, who remained one game behind Tampa Bay for the second AL wild card. After taking three of four from Baltimore, New York travels next to first-place Boston for a weekend series between division rivals.
“It’s important,” manager Joe Girardi said. “We need to continue to win and we need to continue to take series if we want to play in October.”
The Yankees (79-68) moved within one game of their high-water mark for the season, 12 games over .500, which last occurred in May. But the victory was marred by another injury, this one to leadoff hitter Brett Gardner, who left in the first inning with a strained muscle on his left side.
“I’ve never had an oblique issue before,” Gardner said. “The best thing to do is just wait until (Friday) and see what the MRI says. That’ll paint a much clearer picture.”
New York led 5-1 before Nick Markakis hit a solo shot in the seventh and Danny Valencia homered with two on against David Robertson in the eighth.
But the Yankees bounced right back in the ninth with an unearned run against Johnson (3-8). Ryan, obtained in a trade with Seattle on Tuesday, led off with a single. Chris Stewart bunted, and Johnson threw wildly into center field for an error that left two on.
After another bunt put the runners at second and third, Johnson uncorked a pitch that didn’t reach the plate and bounced to the backstop.
Mariano Rivera (6-2) got straight three outs in the bottom half and was given credit for the win by the official scorer because Robertson was ineffective in the eighth.
RAYS 4, RED SOX 3
ST. PETERSBURG, Fla. — Wil Myers hit a tiebreaking double in the eighth inning and Tampa Bay avoided a three-game sweep. Myers drove in Evan Longoria, who also doubled off Rubby De La Rosa (0-1), to give the Rays a 4-3 lead.
ATHLETICS 8, TWINS 2
MINNEAPOLIS — A.J. Griffin allowed two hits in seven innings for Oakland.
Josh Reddick homered and had three RBIs for Oakland, which has a 3½-game lead over idle Texas in the AL West. It is Oakland’s largest lead over the Rangers since Aug. 3. The teams are to scheduled play a three-game series this weekend in the Lone Star State.
ANGELS 4, BLUE JAYS 3
TORONTO — Garrett Richards pitched 6 2-3 innings for his third straight win and Kole Calhoun hit a solo home run as Los Angeles completed a three-game sweep.
Erick Aybar had two hits and scored twice as the Angels won for the 15th time in 20 games and improved to 12-2 in their past 14 road contests.
INDIANS 14, WHITE SOX 3
CHICAGO — Ryan Raburn went 3 for 3 with a homer and five RBIs for Cleveland, which remained 1 1-2 games out of the second AL wild-card spot.
BRAVES 6, MARLINS 1
MIAMI — Freddy Garcia earned his second NL victory since 2007, and first since joining the Atlanta Braves last month, by pitching six innings.
Freddie Freeman had three hits on his 24th birthday, including his 20th home run. Chris Johnson had three hits to raise his average to .330.
PIRATES 3, CUBS 1
PITTSBURGH — Jeff Locke allowed three hits over seven innings to earn his first victory in nearly two months as Pittsburgh beat Chicago to move into a tie for the NL Central lead.
Locke (10-5) struck out five and walked one to help the Pirates win their fourth straight and pull even with St. Louis at 85-61. Mark Melancon worked out of a two-on, none-out jam in the ninth for his 14th save.
Jordy Mercer went 2 for 4 with an RBI double for Pittsburgh. Marlon Byrd and Pedro Alvarez each added an RBI single.
BREWERS 5, CARDINALS 3
ST. LOUIS — Tyler Thornburg threw six solid innings, Sean Halton homered and Milwaukee snapped St. Louis’ five-game winning streak.
NATIONALS 7, METS 2
NEW YORK — Ryan Zimmerman, Adam LaRoche and Wilson Ramos homered off Aaron Harang in his Mets debut, and Washington completed a four-game sweep.
Anthony Rendon also connected for Washington, which outhomered the Mets 13-0 in a series that helped the Nationals remain on the fringe of the NL wild-card race.
PHILLIES 10, PADRES 5
PHILADELPHIA — Carlos Ruiz had three hits and three RBIs, and rookie Cesar Hernandez reached base four times, scored twice and drove in two runs as Philadelphia rode a six-run first inning.