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.
Man spent 15 hours in jail for plugging electric car into an outlet at a school
Texas principal bans speaking Spanish, stirs controversy