Brian Dozier delivered a walk-off sacrifice fly in the 12th inning as the Dodgers rescued their own bullpen and ended a five-game losing streak with a 4-3 victory over the Giants.