The two-time NL Cy Young Award winner tossed seven shutout innings and snapped his career-high 10-start winless streak as San Francisco blanked the Los Angeles Dodgers for a third straight game, 3-0, to complete a sweep and pull even with their bitter rivals atop the NL West.
It was the first time the Giants held the Dodgers scoreless for three games in a row during the San Francisco era.
After going 0-6 with a robust 6.31 ERA during his 10-game winless streak, Lincecum (3-8) fanned eight while scattering four hits and walking two.
"Timmy was Timmy today," San Francisco manager Bruce Bochy said. "He came off a pretty good game in Oakland, carried that into today's game and threw great."
Angel Pagan registered an RBI single and drew a bases-loaded walk, Ryan Theriot had a hit and two runs scored and Brandon Crawford racked up three hits for the Giants, who have won five of their last six games.
Sergio Romo spun 1 1/3 innings to notch his fourth save of the year.
Chad Billingsley (4-7) surrendered three runs on nine hits and three walks for Los Angeles, which went 1-8 on its nine-game road trip.
"It's been a long nine days," catcher A.J. Ellis said.
The bad road trip got worse in the first inning as Andre Ethier left the game with a left oblique strain on a check swing.
He will undergo an MRI on Thursday.
The Giants plated a pair of two-out runs in the third and added another in the fifth.
In the third, Melky Cabrera ripped an RBI double to left that Bobby Abreu trapped and Pagan's bases-loaded walk gave San Francisco a 2-0 advantage while Pagan's RBI single through the hole on the right side made it 3-0 in the fifth.
Los Angeles' best opportunities to score came in the first and third innings.
With men on first and second with one away in the opening frame, Lincecum escaped unscathed as he induced Juan Rivera into an inning-ending 5-4-3 double play.
In the third, Billingsley, who stroked a two-out double, stood at third with one away. With Dee Gordon batting, Lincecum fired a wild pitch that hopped past Hector Sanchez. He received a fortuitous bounce off the back wall, retrieved it quickly and flipped to Lincecum who applied the tag on Billingsley for the out.
Lincecum's last win prior to Wednesday's game was on April 28 against San Diego...San Francisco was 3-for-11 with runners in scoring position while Los Angeles was 0-for-5 with RISP.
For more on the Giants, head to McCovey Chronicles.