ANAHEIM, California (AP) — Colorado kept its NHL playoff hopes mathematically alive with a 4-2 win at league-leading Anaheim on Friday, with Matt Duchene scoring the go-ahead goal on a breakaway midway through the third period.

With four games to play, the Avalanche is six points off the last playoff spot in the Western Conference, and moved level with Dallas, which was beaten at home by St. Louis in an extraordinary game that saw four goals scored in the space of just 49 seconds.

Elsewhere, out-of-contention New Jersey won its first game in seven by defeating Montreal in a shootout, preventing the Canadiens from going back to the top of the Eastern Conference.

Colorado's Duchene pulled in the puck after Corey Perry could not control it in the Avalanche zone and rocketed down the ice. Barely a step ahead of Sami Vatanen, Duchene beat John Gibson under the goaltender's left leg for his 21st of the season.

The Avalanche's playoff hopes are slim, but its final game is against Los Angeles; a rival for that eighth spot.

St. Louis scored four goals in the third period to overrun Dallas 7-5 and move into a tie with Nashville atop the Central Division.

Alex Pietrangelo scored the go-ahead goal on a power play midway through the third.

The four goals in 49 seconds was a league record. It began when Dallas' Travis Moen scored on a penalty shot at 19:49 of the first period. During the first 38 seconds of the second, St. Louis' Patrik Berglund and Jaden Schwartz and Dallas' Jamie Benn all scored.

Benn had two scores as the Stars rallied for four second-period goals to turn a 3-1 deficit into a 5-3 lead.

Berglund also scored twice for the Blues.

New Jersey's Jacob Josefson and Patrik Elias scored in the shootout to give the Devils a 3-2 victory over Montreal.

Stefan Matteau and Reid Boucher, who were called up from the minors last month for the out-of-contention Devils, both scored in regulation.

Tomas Plekanec and defenseman Jeff Petry scored for the Canadiens, who edged two points ahead of Tampa Bay in the fight for the Atlantic Division title with three games to play.

Chicago's Jonathan Toews scored twice 47 seconds apart in the final two minutes to rally the Blackhawks to a 4-3 win at last-placed Buffalo.

San Jose moved within three points of the final wild-card spot in the West by winning 3-1 against Arizona after Logan Couture and Joe Pavelski both scored in the opening five minutes.