Giants rally with 4 runs in 9th to down Dodgers, 5-2