Clayton Kershaw and Madison Bumgarner dueled through five scoreless innings before the Dodgers gave their ace a 2-0 lead.
It didn't hold up after Kershaw got tagged for three runs in the seventh, and the San Francisco Giants went on to a 4-2 victory Friday night.
The Dodgers had a two-out rally going in the ninth, with runners on first and third.
But pinch-hitter Adrian Gonzalez's hard grounder hit off Sergio Romo's right foot and bounced to third baseman Joaquin Arias, who threw to first for the final 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.
''It should have been three,'' Kershaw said. ''Hopefully we can close it out pretty soon.''
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.
''The breaks didn't go our way. It...