The Giants kept their slim NL West hopes alive, scoring three in the 13th to beat the Dodgers 5-2 in Los Angeles on Monday night.