Brian Dozier hit a game-ending sacrifice fly in the 12th inning to give the Dodgers a 4-3 victory over the visiting San Francisco Giants and end Los Angeles’ five-game losing streak.Yasmani Grandal doubled to open the 12th inning against Giants reliever Casey Kelly (0-1). Grandal took third on Max Muncy’s single and scored on Dozier’s second career game-ending RBI.The Dodgers’ recent bullpen issues surfaced once again in the late innings as Andrew McCutchen crushed a game-tying, three-run home run to center field in the eighth inning off lefty Caleb Ferguson.In the Dodgers’ previous four games, the bullpen gave up the go-ahead run in the ninth inning. McCutchen’s home run meant that Los Angeles relievers had blown a lead in seven consecutive games. The Dodgers have now won two of those contests.Dodgers reliever Pedro Baez (4-3) retired all six batters he faced for the victory. Erik Goeddel, Scott Alexander and Baez held the Giants scoreless over the final 4 1/3 innings.Hyun-Jin Ryu pitched six scoreless innings for the Dodgers in his return from the disabled list. Ryu struck out six, walked none and gave up just three hits as he threw 89 pitches in his first start since May 2. He had been sidelined due to a left groin strain.Yasiel Puig’s double to lead off the sixth was the third leadoff double in the game for the Dodgers, but the first to pay dividends. Puig went to third on a fly ball from pinch hitter Grandal and scored when pinch hitter Joc Pederson hit a fly ball to right.Puig’s production came one night after he was ejected for an on-field scuffle with Giants catcher Nick Hundley, who went 0-for-1 as a pinch hitter Wednesday.The Dodgers added a pair of runs in the seventh inning. Justin Turner walked, Manny Machado had an RBI double and Matt Kemp followed with an RBI single. It was Machado’s second consecutive game with an RBI after he failed to drive in a run from July 31 through Monday. Kemp has just three RBIs in August.Machado had three hits while Kemp and Enrique Hernandez had two apiece. Hunter Pence collected half of the Giants’ six hits.San Francisco starter Derek Holland gave up six hits and four walks over 4 2/3 scoreless innings, striking out seven.