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.
Ducks coach Joel Quenneville did not have an update on Gauthier after the game.
"We'll see how he is (Tuesday) and get a better read on it," Quenneville said.
Anaheim extended its first-place lead in the Pacific Division to four points over the Edmonton Oilers.
“We should have had two points in the game and been moving on," Carlson said. "I think we did a good job for a lot of the game in terms of how we played, and in terms of dealing with the emotions and dealing with what it was, but we’ve got to be more mature and come out on top of these games when we're coming down the stretch."
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.
The Maple Leafs also rallied from a two-goal deficit to defeat the Ducks 6-4 in Toronto on March 12.
"It was a gutsy win by us," Rielly said. "Our special teams were good too. I felt like it was back and forth. Obviously, lots of penalties both ways, but I felt like we stuck with it and did a great job."
After the Maple Leafs killed a two-minute 5-on-3 power play in the opening minutes, Carlsson gave the Ducks a 1-0 lead at 6:43 of the first period after Troy Terry made a cross-ice feed to him on the rush.
Gauthier’s power-play goal extended it to 2-0 lead at 9:46, appearing to surprise Stolarz with a wrist shot from near the wall that squeezed through his pads.
Gauthier, who leads the Ducks with 38 goals, left later in the period and did not return.