William Nylander had a goal and an assist, and Matt Murray made 19 saves in his Toronto debut.
"It takes a couple bounces, it ends up right on their tape in the slot," Murray said of Anderson's goal. "I didn't see the release, and the guy put it post-and-in, so just a bit of bad luck there."
The Maple Leafs host the Washington Capitals on Thursday (7:30 p.m. ET; TVAS, TSN4, NBCSWA, ESPN+, SN NOW).
"It was a tough one to swallow in the last few minutes," captain John Tavares said. "We give one up, we tie it, we give one up again. It's disappointing. We have to learn from it quick, get back in front of 'Leafs Nation' tomorrow and feed off our fans and bounce back."
Nylander tied it at 3-3 with 1:50 remaining, 40 seconds after Sean Monahan scored in his Montreal debut at 17:30 to make it 3-2.
"I just tried to get in an open area, and I think the puck went off of 'Andy's' foot, and I had a Grade A look," Monahan said. "Those are the ones you dream of."