LOS ANGELES (AP) -- Hunter Pence hit two more home runs, pinch-hitter Brett Pill connected for a tiebreaking shot leading off the eighth inning, and the San Francisco Giants beat the Los Angeles Dodgers 4-3 Sunday.
Pinch-hitter Yasiel Puig grounded out with the bases loaded to end the game. The NL West-leading Dodgers lost three of four to San Francisco, and the magic number to clinch their first division title since 2009 remained at four after second-place Arizona won.
Pence has 19 RBIs in six games. He drove in three, a day after his grand slam and career-high seven RBIs led the Giants to a 19-3 rout at Dodger Stadium.
Jean Machi (3-1) pitched one inning. Sergio Romo closed for his 35th save in 39 chances.
Paco Rodriguez (3-3) gave up Pill's homer.
Pence homered leading off the second for a 1-0 lead.
The Giants tied it at 3 with two outs in the sixth on Pence's two-run shot. Brandon Belt singled and moved up on a wild pitch by Edinson Volquez before Pence hit his 25th homer.
Los Angeles took a 3-1 lead in the fifth on Adrian Gonzalez's bases-loaded double down the right-field line. With one out, Volquez reached on an infield single, Dee Gordon followed with a single and Mark Ellis got hit by a pitch.
The Dodgers thought they had tied it at 1 in the fourth, but a video review showed the ball bounced near the top of the center-field wall and Juan Uribe was credited with a triple rather than a home run.
Giants starter Ryan Vogelsong allowed three runs and seven hits in six innings. Volquez gave up three runs and five hits in 5 2-3 innings, struck out seven and walked none.
NOTES: It was Pence's ninth career multihomer game. ... The Dodgers were without SS Hanley Ramirez and OFs Andre Ethier and Carl Crawford, all of whom have nagging injuries. ... Giants 2B Marco Scutaro left the game in the middle of the third with lower back tightness. ... The Dodgers are the first major league team to exceed 3.5 million in attendance this season. They lead the majors in both average home and road attendance (35,622). ... After an off-day Monday, the Giants will spend the week in New York playing the Mets and Yankees, the first time they've played both teams in the same week.