It was a Jekyll and Hyde performance for the Leafs, who were booed off the ice after a woeful first period that saw them outplayed, outshot 6-2 and outscored 1-0. Kessel struck twice in the second period as Toronto scored four unanswered goals to climb out of a 2-0 deficit.
Captain Dion Phaneuf also scored for the Leafs (7-3-0) before an Air Canada Centre crowd of 19,408.
James van Riemsdyk, who played provider to Kessel most of the night, had a chance to make it 5-2 in the third period but hit the goalpost with a backhand on a penalty shot after being interfered with on a breakaway.
Kessel, whose offence had been sporadic at best this season, upped his goal total to five with the hat trick. The Leafs sniper had a chance to go for a fourth late in the game but chose to pass it to linemate Tyler Bozak, who failed to convert.
The win snapped a two-game losing streak for the Leafs and coach Randy Carlyle, who led the Ducks to the Stanley Cup in 2007 before being fired in 2011.
Tuesday's game was the first stop on a season-long eight-game road trip for the Ducks, a journey that will cover 15 days and 13,215 kilometres.
Anaheim outshot Toronto 25-23.
Shots have been hard to come by for the Leafs, who were outshot 115-60 in their three previous games. Toronto has been outshot in eight of 10 games this season, including its last seven outings.
Neither team showed much in a loose first period that saw Toronto register its first shot 27 seconds in and then not put another on Jonas Hiller until an easy long-range shot from defenceman Paul Ranger with 2:56 left in the period.
Thirty-four seconds later, Bonino tapped in a pass from Patrick Maroon on a three-on-one after Leafs defenceman Cody Franson collided with teammate Troy Bodie up ice. It was Bonino's fourth of the year.
Still stuck on two shots, Toronto went down 2-0 at 1:59 of the second period after Perreault was allowed to come out from behind the goal and roof a wrist shot past Jonathan Bernier for his fourth of the year.
Toronto did not manage a third shot until 5:23 of the second period, a snap shot by Jay McClement that produced a fine glove save from the underemployed Hiller. The Ducks goalie then stopped Mason Raymond on a two-on-one as the Leafs managed to move the shot clock again.
Phaneuf tried to start something at the other end, getting the crowd going by sending Kyle Palmieri flying with a bodycheck.
The Leafs finally scored at 7:44 of the second, with Kessel tucking in the puck on the power play after van Riemsdyk stretched to pass a rebound over to his unmarked linemate for his third goal.
Phaneuf then tied it up at 9:03, cruising in from the blue-line to bang home a rebound for his second of the season.
The dazed Ducks called a timeout to regroup.
Toronto had to survive an 87-second five-on-three power play later in the period.
Kessel scored again after Ranger dispossessed a Duck and sent his winger off on a two-on-one with van Riemsdyk. Kessel held onto the puck and beat Hiller at 16:09 for a 3-2 lead and his fourth goal of the campaign.
The shot count was tied 12-12 after two periods with Bernier making some timely stops in the third.
Kessel made it 4-2 at 8:11 of the third, effortlessly converting a two-on-one with van Riemsdyk.
It was the Ducks' first defeat since a season-opening 6-1 loss in Colorado. Anaheim arrived in Toronto on a seven-game win streak, tied for the longest in club history (set previously between Feb. 20 and March 7, 1999).
The loss dropped the Ducks' record at the Air Canada Centre to 3-12-4 and Hiller's career mark against the Leafs to 0-4-0.
The last time the two clubs met, a 5-2 Toronto win at the Honda Center on Nov. 27, 2011, Carlyle was behind the Ducks' bench. He was fired three days later and replaced by Bruce Boudreau.
NOTES — Steve Yzerman and Peter Chiarelli of the Canadian Olympic team braintrust took in the game ... Anaheim continues its road trip on Thursday in Montreal and Friday in Ottawa ... The Leafs will finally get forward David Clarkson back from his 10-game suspension on Friday in Columbus.