Lincecum (2-2) limited the Padres to one unearned tally on three hits, overcoming four walks and striking out five to win his second straight start.
The Giants right-hander, however, trailed 1-0 until the seventh inning when San Francisco came up with two scores.
Melky Cabrera led off the frame with a double off Anthony Bass and two outs later went to third on a single by Nate Schierholtz.
Brandon Belt then sliced a 2-0 pitch into the left-center field gap for a go-ahead, two-run double and the Giants held on to even their three-game series with the Padres.
Bass (1-3) took the hard-luck loss, yielding just the two runs on six hits in a complete-game effort. The right-hander didn't allow a walk and fanned eight.
Nick Hundley got San Diego's only RBI.
Swim Week Miami Beach 2014 [PHOTOS]