Miller one-timed a pass from Mika Zibanejad past Montreal goalie Jacob Fowler after he tied the game in the second period.
Noah Laba, Artemi Panarin and Will Cuylle also scored, Connor Sheary and Matthew Robertson each had two assists and Igor Shesterkin made 12 saves for the Rangers (16-13-4), who snapped a three-game losing streak.
Zachary Bolduc, Arber Xhekaj, Jake Evans and Josh Anderson scored, Nick Suzuki and Lane Hutson each had two assists and Fowler made 21 saves for the Canadiens (16-11-4), who have lost three of four.
The Canadiens took a 1-0 lead at 12:41 of the first period on their first shot of the game when Bolduc redirected in a pass from Suzuki.
Xhekaj made it 2-0 Montreal at 14:10 when he scored his first goal of the season on a wrist shot from the blue line. The first two goals came on the Canadiens’ first two shots of the game.
Evans made it 3-0 at 16:18 when he beat Shesterkin with a wrist shot from the left side.
Laba cut the Canadiens’ lead to 3 -1 with a power-play goal at 18:49.
Panarin made it 3-2 just 19 seconds later on a penalty shot at 19:08. Panarin, who beat Fowler to the blocker side, was awarded the penalty shot after being taken down from behind by Noah Dobson on a breakaway. It was his first penalty-shot goal in his NHL career.
Montreal regained a two-goal lead when Anderson’s one-timer from the slot made it 4-2 at 3:17 of the second period.
The Rangers got it back to 4-3 at 7:22 when Cuylle’s shot from behind the goal line banked off Fowler and into the net. New York tied it 4-4 just 36 seconds later when Miller picked up a rebound in the slot and slid it through Fowler’s pads at 7:58.
The Rangers appeared to take a 5-4 lead at 5:51 of the third on a goal by Sam Carrick, but the goal was disallowed because it was determined Carrick kicked the puck in.