Giants starter Matt Cain allowed two runs in five innings in his final regular season start and the Dodgers broke a 2-2 tie in the ninth to keep their slim postseason chances alive.