The Giants have won four straight and six of seven, to remain one game behind the Padres in the N.L. West. San Diego beat the Dodgers 2-1 to stay in front of SF.
Lincecum (13-9) allowed one runner through six innings before the Diamondbacks broke through in the seventh. He left after 6 2/3 innings, giving up three runs and five hits with no walks.
"The Franchise" earned his second victory in a row after an awful August, when the two-time reigning NL Cy Young Award winner went 0-5 with a 7.82 ERA.
The long ball powered the offense. Aubrey Huff, Freddy Sanchez and Pat Burrell all homered off Barry Enright. Huff homered in the first inning to make it 2-0, and the team never looked back.
Closer Brian Wilson was given the night off, leaving Jeremy Affeldt to induce a game-ending double play for a one-pitch save. It was his fourth of the season.
Barry Zito will try to keep the playoff push going Wednesday night, when the Giants wrap up their three game series in Arizona.