The Giants jumped to a 2-0 lead but Gonzalez tied it with a two-run homer in the second and Hinske delivered the winning solo shot in the sixth.
They were the 11th and 12th home runs given up this season by Lincecum (11-5). That equals the most the two-time defending National League Cy Young Award winner has ever allowed in a single season, matching the dozen he surrendered in his rookie year of 2007.
Atlanta, which began the evening's action with a two-game lead over Philadelphia in the NL East, improved the best home record in baseball to 37-14.
Jair Jurrjens (4-4) gave up two runs on seven hits in six innings to get the win. He is 4-0 at home in six starts.
Billy Wagner gave up a two-out single in the ninth but then struck out Freddy Sanchez to end the game and collect his 26th save.
Lincecum was touched for six hits over 6 1/3 innings. He had been 3-0 in his previous five starts.