Cabrera had two hits in his return to AT&T Park with Toronto for the first time since his 50-game suspension for a positive testosterone test last Aug. 15.
Lincecum (4-5) allowed Edwin Encarnacion's first-inning solo home run, then retired the next 14 Blue Jays in order.
Coming off his shortest outing of the year of 4 1-3 innings last Wednesday in a 9-6 loss to Oakland, Lincecum allowed three hits and one run, struck out six and walked one in seven impressive innings.
The Giants handed Josh Johnson (0-2) a loss in his return from the disabled list.
Torres connected for his second homer in the second, and he also made a couple of nice catches in left field behind Lincecum.
The struggling right-hander looked more like his old self after losing four of five starts and five of his last six decisions -- in which he had allowed 27 earned runs in 42 1-3 innings for a 5.74 ERA.
The two-time NL Cy Young Award winner quickly regrouped after Encarancion's 17th home run and found a groove.
Cabrera apologized to the Giants and their fans during a dugout news conference before the game. He was eligible to return for the NL championship series, but the Giants decided in late September 2012 to keep him off the postseason roster the entire way.
Cabrera, the 2012 All-Star game MVP who produced a 51-hit May last year, received his World Series ring when the Giants visited Toronto last month.
Booed -- with no sign of the "Melk Men" who used to cheer him -- by the sellout crowd of 41,981 each time he stepped into the batter's box, Cabrera went 2 for 4 with a leadoff single in the first and another base hit in the sixth but flied out with the tying run at first for the first out in the ninth.
The Blue Jays missed a chance in the sixth. With Johnson aboard on a walk and at second following Cabrera's single, Jose Bautista hit into his second double play of the game with a liner to Pablo Sandoval at third base. Sandoval fired to second and Marco Scutaro made the play but dropped the ball as he tumbled forward, bringing Blue Jays manager John Gibbons out to argue.
Lincecum, knocked out of his only other start against the Blue Jays after 3 2-3 innings in 2007, pumped his fist as he walked off the mound.
The pitcher's recent problems raised speculation of a possible move to the bullpen like the one last fall that was so successful for the club's run to a second World Series championship in three years.