Lincecum (2-0) controlled the Padres on four hits, walking two and striking out eight for the Giants, who won a second straight at home after enduring a three-game sweep in Milwaukee.
Sandoval provided the game's only offense with a two-run blast in the fourth.
San Diego's Andrew Cashner (0-1) absorbed loss while making an emergency start after scheduled pitcher Clayton Richard came down with flu-like symptoms.
The right-hander yielded just Sandoval's homer in four innings, walking one and fanning five.
Toddler uninjured after being knocked over by Obama family dog
Martin Bashir resigns from MSNBC over Sarah Palin comments