Lincecum (3-8) won for the first time since April 28 -- a span of 10 starts -- limiting the Dodgers to four hits and two walks while striking out eight as the Giants completed a three-game sweep of their NL West rivals.
Sergio Romo recorded the final four outs for his fourth save to complete the shutout.
The Giants blanked the Dodgers in all three wins in the series -- the first time that has happened in the history of the two franchises stretching back to 1890.
Angel Pagan drove in two runs with a single and a bases-loaded walk, while Miguel Cabrera added a run-scoring double to provide San Francisco's offense.
Chad Billingsley (4-7) was touched for three runs on nine hits over six full innings for the Dodgers, who had led the Giants by as many as seven games in the division this season.
Los Angeles dropped its fourth straight and eighth in nine contests overall.
Beyonce flaunts bikini body, Blue Ivy in vacation pics
Kate Middleton recycles dress at movie premiere