Nick Suzuki had a goal and an assist, and Noah Dobson scored his first goal of the season for Montreal (15-10-5), which was 0-5-1 during its losing streak. Jacob Fowler made 23 saves.
The Canadiens had been outscored 15-3 while being shut out twice in their past four games.
Sam Reinhart and Anton Lundell scored for Florida (17-10-3), which had won consecutive games and was 5-1-0 in its past six games. Akira Schmid made 26 saves.
Reinhart gave the Panthers a 1-0 lead at 1:17 of the first period. Aleksander Barkov drove the right side before passing back to Aaron Ekblad, who one-timed a slap shot from the right face-off circle that Fowler kicked out to the left side of the slot. Reinhart then knocked the rebound into the open left side of the net.
Fowler stuck out his right pad to stop Carter Verhaeghe at 8:10 with Sam Bennett trailing on a two-man breakaway.
Kapanen tied it 1-1 at 17:28. After Owen Beck’s shot squeezed through Schmid and lay behind him, Panthers defenseman Radko Gudas got his stick down to prevent the puck from crossing the goal line, but Kapanen rushed the net and jammed it in before the Gudas even attempted to clear it.
Lundell put Florida back ahead 2-1 at 4:43 of the second period on a one-timer from the point off Fowler’s glove. With Canadiens defenseman Alexandre Carrier hopping along to the bench after his left skate blade was knocked off, Niko Mikkola found Lundell with Brad Marchand skating across the goalmouth to provide a screen.
Dobson tied it 2-2 at 15:16 with his first goal since Feb. 26. He cut to his right to get back to a loose puck at the left point and drove towards the net before scoring with a wrist shot from the face-off dot that got under Schmid’s right arm.
Suzuki’s power-play goal just 22 seconds into the third period gave Montreal its first lead at 3-2.
Kapaenen scored his second goal of the game, into an empty net, with 19 seconds remaining for the 4-2 final.