Lincecum (7-13) gave up just one run on five hits and one walk over 5 2/3 innings for the division-leading Giants, who have won four of their last five.
Angel Pagan went 3-for-5 with a run scored and an RBI and threw a runner out at the plate to prevent a big sixth inning for Los Angeles.
"It's great to come in here and take the first two games," Giants manager Bruce Bochy said.
San Francisco increased its cushion in the NL West to 1 1/2 games over the second-place Dodgers and will look to complete a three-game sweep when Matt Cain takes the hill Wednesday opposite Chris Capuano.
Joe Blanton (8-12) suffered a third straight loss in a Dodgers uniform, allowing four runs on 10 hits and two walks in 5 2/3 innings.
One night after Madison Bumgarner outdueled Clayton Kershaw in the Giants' 2-1 win, Lincecum showed he still has the arsenal that made him a two-time Cy Young Award winner by retiring the first 10 batters he faced.
Posey gave him some early run support when he singled in Pagan and Marco Scutaro with a base hit to right field in the first.
The Giants tacked on two more in the fourth when Brandon Crawford knocked in Gregor Blanco with a single and scored on Pagan's two-out double to right- center.
Lincecum ran into trouble in the sixth, but Pagan bailed him out when he threw out A.J. Ellis trying to score from second on Shane Victorino's base hit to center. The Dodgers later loaded the bases and only pushed one run across on Matt Kemp's sacrifice fly.
Jose Mijares struck out Andre Ethier to strand runners on the corners in the sixth, and Santiago Casilla hurled two perfect innings leading up to the ninth.
Sergio Romo was pulled after yielding a one-out single to Kemp, and Javier Lopez induced a game-ending double-play ground ball off the bat of Ethier to record his third save of the season.
"We had chances, but couldn't get the big hit," Dodgers manager Don Mattingly said.
Lincecum dropped six of his first seven decisions on the road before winning his last three ... The Giants have gone 5-0-1 in five road series since the All-Star break... The Dodgers fell to 6-11 at home since the All-Star break ... Adam Kennedy had two of LA's six hits.