PHILADELPHIA -- Erik Gustafsson scored the go-ahead goal 90 seconds after Wayne Simmonds tied it late in the third period and the Philadelphia Flyers rallied for a 5-3 victory over the Montreal Canadiens on Wednesday night at Wells Fargo Center.
Sean Couturier, Simon Gagne and Jakub Voracek also had goals for Philadelphia (16-17-3), which is in danger of missing the playoffs for the first time since 2007 and second time in 18 years.
The Flyers closed within four points of the New York Islanders for the final seed in the East.
Brandon Prust and David Desharnais scored 20 seconds apart in the second period to give the Canadiens a lead. Alexei Emelin also had a goal for the Canadiens (23-8-5), who are second in the Eastern Conference.
Simmonds got the tying goal with 5:06 left when Bruno Gervais' slap shot hit his skate and trickled past goaltender Carey Price.
Then Gustafsson made a nifty move to set up the go-ahead goal. He skated in, deked defenseman Davis Drewiske and flipped a pass toward Matt Read that seemingly hit off defenseman Francis Bouillon's left skate and went in.
Voracek then added an empty-net goal.
The Flyers wrapped up their five-game homestand with consecutive comeback wins in the third period.
Just 46 seconds after Gagne whacked in a rebound to give the Flyers a 2-1 lead in the second period, Prust scored to tie it. Jeff Halpern set it up with a crossing pass to Prust, who ripped a shot inside the near post.
Desharnais then got a fluke goal when his slap shot from the left side deflected off Brayden Schenn and sailed over goaltender Ilya Bryzgalov's head to put the Canadiens up 3-2. Bryzgalov ducked and threw his arms up as the puck fluttered toward his mask.
Emelin gave the Canadiens a 1-0 lead in the first with his third goal of the season.
The Flyers tied it at 1 early in the second period when Couturier scored his first goal in 27 games. Couturier's shot from the side of the net, bounced off goalie Carey Price, hit defenseman P.K. Subban's leg and went in.
NOTES: The Flyers acquired Steve Mason from Columbus for Michael Leighton in a trade of backup goalies. Mason will back up Bryzgalov, who made his 20th straight start. ... The Flyers completed a five-game homestand. ... Forward Max Talbot (broken left leg) joined forward Danny Briere (concussion) and defensemen Andrej Meszaros (shoulder), Braydon Coburn (shoulder) and Nicklas Grossmann (upper body) on Philadelphia's lengthy injury report. ... Emelin's goal was his first in 11 games. ... Montreal's Brandon Prust, who recently returned after missing eight games with a shoulder injury, fought Zac Rinaldo in the first period.