Toronto had lost its previous seven home games against the Red Sox.
Boston took a 5-3 lead through three innings, but Gonzalez tied it with his homer and a two-run double by Fred Lewis in the fifth put Toronto in front for good.
Adam Lind and Jose Bautista added solo homers to finish the scoring. It was the 24th home run of the season for Bautista, tops in the majors.
The win went to Shawn Camp (3-1), who threw 1 2/3 innings of scoreless relief. Kevin Gregg recorded the final four outs for his 20th save.
Boston starter John Lackey (9-5) gave up seven runs on eight hits over 4 2/3 to take the loss.
Copyright 2010 United Press International, Inc. (UPI).