MONTREAL -- It took a 62-second outburst in the third period for the Montreal Canadiens to turn a sour mood in the Bell Centre into a celebration.

Alexei Emelin, Max Pacioretty and Paul Byron got the rapid-fire goals as the Canadiens rebounded from allowing a controversial goal and the ejection of winger Andrew Shaw to post a 5-4 victory over the New York Rangers on Saturday night.

"It was fun. It felt like a playoff game," said Pacioretty. "It felt like there were a lot of Rangers fans here.

"It was a fast game and we knew they played (Friday) night and that, if we kept skating their defence, eventually we'd get our breaks."

The Rangers, coming off a 4-2 loss at home to Toronto, lost the second of back-to-back games for the first time in eight occasions this season.

The Canadiens were coming off an embarrassing 7-1 loss in Minnesota, one night after winning in Winnipeg.

"The way we play is we want to wear teams down, especially against a team that's on the second leg of a back to back," said Pacioretty. "You know if you skate their D that they're only human.

"We know what it's like to be on the other side of that. We don't want to make excuses because we know how hard it can be, especially when the building gets into it. We take pride in our forecheck, with four lines. It lets us wear teams down and get our chances late in the game."

Alex Galchenyuk, back from a knee injury suffered Dec. 4, and Brian Flynn also scored for Montreal (27-11-6), while Philippe Danault had three assists.

Brandon Pirri, Rick Nash, J.T. Miler and Derek Stepan scored for the Rangers (28-15-1), who ended a four-game winning run in road games.

"Unfortunately in that short span there we made a couple of mistakes that ended up in the back of our net, but we battled hard," said Rangers coach Alain Vigneault. "We came out, we scored four goals on (Carey) Price, which we hadn't done, I don't think, in a while.

"And unfortunately the game got away from us. We tried to battle back at the end and weren't able to get it done."

Montreal had both Galchenyuk and Andrew Shaw back from injuries but Shaw's game lasted only 16:56 before he was tossed. Shaw, whose goalie interference penalty nullified a Montreal goal at 4:00, knocked Jesper Fast over with an open ice-hit and then fought Miller, drawing an interference major, a fighting major and a game misconduct. Fast was shaken up but stayed in the game.

But then Antti Raanta, who stopped all 10 shots he faced, left after the first period with a lower-body injury and was replaced in goal by Henrik Lundqvist, who has a history of struggling in Montreal and let in five goals on 22 shots.

Final shots were 33-32 in New York's favour.

The Rangers needed only four seconds into a power play to get the opening goal when Pirri wired a shot in off a goalpost on his off-wing at 12:24 of the first period.

Galchenyuk scored 3:08 into the second with a deflection of Mark Barberio's point shot, but Nash got it back on a controversial goal at 6:20.

Price made a brilliant save on a Kevin Hayes breakaway, but the Rangers forward then pulled the goalie out of his crease when his skate got caught in Price's pads. Nash shot into the empty net. After video review, it was ruled a good goal and the sellout Bell Centre crowd booed long and loud.

"I disagree with the call," was all Price would say.

Montreal got it back at 7:58 when Flynn scored from a scramble in front of Lundqvist but Miller put New York back ahead when he finished a short-handed two-on-one with Hayes after Galchenyuk lost the puck on the right point.

It marked the seventh time in eight games that Price has allowed three or more goals, including the seven he let in at Minnesota.

"In Minnesota, it didn't matter what we did, everything was going in our net," said Byron. "But everyone stuck together. Credit to Carey for staying in and battling for us. It means a lot to our team. I thought we answered well."

The Canadiens answered when Emelin's wrist shot from the left point went in off defenceman Adam Clendening 10:53 into the third frame. Pacioretty got his 20th of the season on a breakaway only 36 seconds later and, only 26 seconds after that, Byron backhanded the puck in front and saw it go in off Clendening's stick.

New York got one back at 14:53 when Mats Zuccarello tipped the puck in mid-air and Stepan batted it in out of the air at the side of the net. That was also reviewed and it was ruled Stepan did not score with a high stick, leaving the Rangers 3-for-3 in video reviews for the night.

Montreal's Michel Therrien coached his 800th NHL game.