Tavares, who also had an assist, scored on a redirection in front off a pass from Morgan Rielly after the Maple Leafs rallied from a two-goal deficit midway through the third period.
Leo Carlsson’s second goal tied it 4-4 for Anaheim with 1:39 remaining in the third when he scored on a rebound from the left face-off circle will goaltender Ville Husso pulled for the extra skater.
William Nylander had a goal and three assists, Rielly had a goal and an assist, and Oliver Ekman-Larsson had two assists for the Maple Leafs (32-30-13), who have won three of four (3-1-0). Anthony Stolarz made 28 saves.
Cutter Gauthier scored before leaving with an upper-body injury, and John Carlson scored his first goal with the Ducks (41-28-5), who have lost two in a row but have points in seven of their past eight (5-1-2). Jackson LaCombe had two assists, and Husso made 23 saves.
Anaheim extended its first-place lead in the Pacific Division to four points over the Edmonton Oilers.
Rielly scored at 17:00 of the third period to give the Maple Leafs a 4-3 lead after they trailed 3-1 at the start of the third.
After the Maple Leafs killed a two-minute 5-on-3 power play in the opening minutes, the Ducks took a 1-0 lead at 6:43 of the first after Troy Terry made a cross-ice feed to Carlsson on a rush and he scored into the open side of the net.
Anaheim was on its second power play of the game when Gauthier appeared to surprise Stolarz with a wrist shot from near the wall that squeezed through his pads for a 2-0 lead at 9:46.
Gauthier, who leads the Ducks with 38 goals, left later in the first period with an upper-body injury.
Tavares scored on the power play to cut it to 2-1 at 14:18, shooting a bouncing rebound into the net from between the hash marks.
Carlson extended it to 3-1 at 11:33 of the second period. LaCombe brought the puck into the Toronto zone before dropping a pass for his defense partner, who skated into the right face-off circle before scoring with a wrist shot over the glove of Stolarz.
Carlson was acquired from the Washington Capitals on March 5 for a conditional first-round pick in the 2026 NHL Draft and a third-round pick in the 2027 NHL Draft.
Matthew Knies cut it to 3-2 at 6:55 of the third with a snap shot from above the left circle while on Toronto's fifth power play. Nylander then scored on a breakaway to tie it 3-3 at 10:14 off a turnover by Ducks forward Beckett Sennecke.