Maile also had an RBI single in addition to his first career multi-homer game in the opener of a three-game series.
His game-winner came against left-hander Brian Johnson (1-2) after Curtis Granderson led off the 12th with a walk.
Sam Gaviglio (1-0), just recalled from Triple-A Buffalo, allowed one hit over three scoreless relief innings to earn the win.
Xander Bogaerts homered for Boston.
Boston starter Chris Sale matched his career best with 15 strikeouts in nine innings, allowing three runs, six hits and no walks.
Toronto starter Aaron Sanchez allowed three runs (two earned), five hits and three walks while striking out four in five innings.
Each team scored once in the first.
Boston scored when Mookie Betts walked, took third on a single by Andrew Benintendi and came around on a groundout to first by J.D. Martinez.
Toronto tied it when Teoscar Hernandez doubled and scored on a single by Josh Donaldson.
The Blue Jays led 2-1 in the second after Kendrys Morales ended a career-long 0-for-28 hitless drought with a double, took third on Anthony Alford's flyout and scored on Maile's single.
Bogaerts led off the fourth with his fourth homer of the season. The Red Sox added an unearned run in the inning to go ahead 3-2. Brock Holt scored from first when Sandy Leon struck out and went to third on a passed ball and throwing error by catcher Maile.
Sale struck out his next six batters on the way to retiring 11 in a row before Maile hit his first homer with two out in the seventh.
Toronto's John Axford pitched around a walk in the sixth and Seunghwan Oh pitched a perfect seventh.
Ryan Tepera pitched a perfect eighth for Toronto, and Tyler Clippard did the same in the ninth.
Boston reliever Matt Barnes survived two walks in the bottom of the 10th.
Carson Smith worked around a single and a stolen base by Kevin Pillar in the bottom of the 11th.
Before the game, the Blue Jays put right-hander Marcus Stroman on the disabled list with shoulder fatigue and optioned left-hander Tim Mayza to Triple-A Buffalo. Right-handers Joe Biagini and Gaviglio were recalled from Buffalo.
--Field Level Media
Boston | Toronto | |
Chris Sale | Player | Aaron Sanchez |
No Decision | W/L | No Decision |
9.0 | IP | 5.0 |
15 | Strikeouts | 4 |
6 | Hits | 5 |
3.00 | ERA | 3.60 |
Boston | Toronto | |
Xander Bogaerts | Player | Luke Maile |
1 | Hits | 3 |
1 | RBI | 4 |
1 | HR | 2 |
4 | TB | 9 |
.250 | Avg | .750 |