Boston will face the Florida Panthers in the Eastern Conference First Round of the Stanley Cup Playoffs, which begin Monday.
"They've played us tough," Bruins forward Trent Frederic said. "They're a good team. They've got a lot of star power over there, guys who can score and play, and they play hard. It won't be easy by any means, it's going to be a battle, and I think we're looking forward to that challenge against them, and we're just excited to get going now that we finally know who we're playing."
Michael Pezzetta had a goal and an assist, Lucas Condotta scored in his NHL debut, and Sam Montembeault made 16 saves for Montreal (31-45-6), which lost for the third straight game and seventh time in eight games.
"I think this year we were in the infant stage of where we want to be and next year we'll just be still further along," Canadiens coach Martin St. Louis said. "How fast we get to that, I don't know.
"But to me it's more like when do we flip? Or how long it's going to take, or how far we can take it? I don't know when it's going to flip but I'm looking forward to that day."
Bruins center Patrice Bergeron left the game after the first period for precautionary reasons because of an upper-body injury.
"Oh yeah, '37' is fine," Montgomery said. "He wanted to go back out, and I said no."
Justin Barron gave Montreal a 4-3 lead at 1:09 of the third period with a short-handed goal when he pinched into the slot to get on a loose puck and put a slap shot past Swayman's glove.
Charlie Coyle tied it 4-4 at 8:48, and Pastrnak put Boston up 5-4 at 11:00 when he scored from the right edge of the crease after Orlov's crossing pass.
"They were playing loose and looking for fast breaks, and they caught us a few times," Frederic said. "… But it's kind of back and forth and it's a tight one, forces us to play the right way, especially in that third period."
Condotta gave Montreal a 1-0 lead at 3:27 of the first period, scoring on a rebound in front after being recalled from Laval of the American Hockey League earlier in the day.
"It's a great feeling," Condotta said. "I'm kind of speechless. I don't know what to say."