The Giants, off to a 4-10 start after losing nine of their last 10, welcomed the Dodgers and their seven-game winning streak to AT&T Park and then tried to nibble them to death before discovering the beauty of the two-run homer.
The Giants used five infield singles, a broken-bat double and a triple off an outfielder's glove to take the early lead, added a late two-run homer from Justin Maxwell and worked it for a 6-2 victory over the Dodgers.
Their first four runs came against left-hander Brett Anderson, who must have left the game wondering what had just happened.
The Giants began pecking away in the second when Maxwell tripled off the glove of Joc Pederson in center. Brandon Crawford hit a slow roller to second he beat out for an infield hit, and the Giants had their first run.
Andrew Susac opened the fourth with another infield hit. Noticing a theme here?
Crawford's broken-bat double put runners at the corners. The Giants scored one on -- what else? -- an infield single to Adrian Gonzalez, who threw the ball away for an error to allow a second run in the inning to score.
That gave the Giants a 4-0 lead, but because the Dodgers came in averaging 5.25 runs per game and there were still five innings to go, it wasn't like the game appeared out of reach. Particularly since right-hander Tim Lincecum started for the Giants.
Only the Dodgers never really could get it going and never tapped into that comeback routine they had used so effectively on their last homestand.
They scored their only run in the fifth on doubles by Juan Uribe and pinch-hitter Alex Guerrero.
Otherwise, Lincecum was in control. He went six strong innings, holding the Dodgers to one run on five hits and three walks, striking out five. If it wasn't vintage Lincecum circa his Cy Young days in 2008-09, it was plenty effective.
Anderson lasted only four innings for the Dodgers, throwing 72 pitches. He surrendered four runs on nine hits. He did not walk a batter and struck out one.
The Giants completed their scoring in the eighth when Maxwell hit his two-run homer off Pedro Baez. The Dodgers bullpen had allowed only one earned run in its last 23 1/3 innings prior to Maxwell’s blast.
This night belonged all to the Giants.
Jeremy Affeldt, Sergio Romo, Javier Lopez, Jean Machi and Santiago Casilla held the Dodgers scoreless until they scored a final run with two outs in the bottom of the ninth. The Dodgers bounced into four double plays.
Crawford turned a terrific double play and Maxwell made a wonderful sliding catch into the right-field corner with two on in in the eighth, and for one night the Giants rediscovered their winning ways.
Follow Steve Dilbeck on Twitter @stevedilbeck