Eugenio Velez, Pablo Sandoval and Aaron Rowand homered and pinch-hitter Fred Lewis doubled home the go-ahead run with two outs in the sixth inning, giving the Giants an 8-4 win Friday night in the series opener.
Manny Ramirez and Rafael Furcal homered for Los Angeles, which maintained its five-game lead over Colorado in the NL West when the Rockies lost 7-5 at Arizona.
The Giants' 80th victory - their most since winning 91 in 2004 - moved them 2 1/2 games behind Colorado in the wild-card race.
"Great job the bullpen did picking each other up," Giants manager Bruce Bochy said. "That's what wins ballgames for you, the bullpen doing its job."
The Giants lost two of three at home to the Dodgers last weekend, when Vicente Padilla was especially effective against them. But he didn't have it this time, giving up four runs and eight hits in five innings, striking out three and walking one.
"He didn't have the same command he had in his last couple of starts, but he still hung around and kept us in the game," catcher Russell Martin said. "It was a tough game, but I didn't think he did a bad job out there."
Lewis doubled over left fielder Ramirez's head, scoring Travis Ishikawa, who doubled to right center and took third on a strikeout and fielder's choice when Rowand was thrown out at first by Martin.
"I saw a fastball that was real close. He tried to run back with the same pitch and it hung over the plate," said Lewis, who thought Ramirez had a shot at making the catch.
"I'm going to have to take him out to dinner. I'm thankful he didn't catch it."
Velez doubled home Lewis as the ball again went over Ramirez's head, giving the Giants a 6-4 lead. Velez homered to lead off the game after entering the game hitting just .077 in 11 games against Los Angeles this season.
Bob Howry (2-6) got two outs to finish the fifth inning.
San Francisco extended its lead to 4-1 in the third on Sandoval's three-run homer off the first pitch from Padilla after singles by Velez and Freddy Sanchez.
Ramirez homered and drove in three runs as the Dodgers' three-game winning streak ended.
"They pitched better than we did, it was probably as simple as that," Dodgers manger Joe Torre said. "We kept battling back and we had some opportunities late. We were ready to play, we just didn't pitch well."
Ramon Troncoso (4-4) allowed two runs and three hits in two-thirds of an inning, striking out one and walking none.
Chad Billingsley made his first relief appearance of the season for the Dodgers after being sent to the bullpen. He gave up a homer to Rowand with two outs in the eighth and an RBI single to Juan Uribe in the ninth.
Phillies 9, Braves 4
Ryan Howard homered twice, Jimmy Rollins hit a three-run shot, and visiting Philadelphia won its sixth straight and ended Atlanta's seven-game winning streak.
Tim Hudson (1-1) who gave up six hits, three runs and one walk with three strikeouts in seven innings.
Kyle Kendrick (2-1) won his second consecutive appearance with four scoreless innings.
Diamondbacks 7, Rockies 5
Gerardo Parra doubled in the go-ahead runs, Brandon Allen and Ryan Roberts homered and the last-place Diamondbacks handed the visiting Rockies their fifth loss in six games.
Leo Rosales (2-1) pitched a scoreless seventh. Randy Flores (0-1) faced one batter.
Juan Gutierrez gave up a run in the ninth but stranded the potential tying run at first for his sixth save in seven chances.