Matthew Schaefer scored two goals in 55 seconds in the second period, and Ilya Sorokin had an assist and made 21 saves for New York (33-21-5), which has won three straight.
Noah Dobson scored twice for Montreal (32-17-9), which ended a five-game (4-0-1) point streak. Sam Montembeault made 23 saves.
Lee tied it 3-3 with 1:41 remaining in the third period when Bo Horvat’s shot went in off him while he was set up in front of the crease.
Dobson put the Canadiens up 1-0 at 12:11 of the first period. He took a cross-ice pass from Lane Hutson in the neutral zone before driving in and scoring on a wrist shot under Sorokin’s glove from the left face-off circle.
Dobson scored his second straight against his former team on a power play at 10:06 of the second period to make it 2-0 with a slap shot from the point on a pass from Alexandre Texier.
Alex Newhook got the secondary assist on Dobson’s second goal in his return after missing 40 games because of a broken ankle.
Schaefer cut it to 2-1 with a power-play goal at 17:56. He took a pass from Mathew Barzal at the top of the left face-off circle and scored on a low wrist shot from the top of the slot.
Schaefer tied it 2-2 at 18:51 with a highlight-reel goal. The 18-year-old defenseman carried the puck down the left side, cutting behind the net and skating back toward the right point before curling back to his left and scoring on a wrist shot from the top of the right face-off circle.
It was the third two-goal game of the season for the rookie, who has 18 goals. Brian Leetch holds the NHL record for goals by a rookie defenseman with 23 for the New York Rangers in 1988-89.
Cole Caufield put Montreal up 3-2 with a power-play goal at 9:11 of the third period, jamming in a loose puck in the crease after Ivan Demidov’s shot slipped through Sorokin’s pads.