Updated

Max Pacioretty had two goals and an assist, and P.K. Subban added a goal and two assists in the Montreal Canadiens' 5-3 win over the Edmonton Oilers on Thursday night.

Tomas Kaberle and Lars Eller also scored for Montreal (26-32-10), which won for the second time in nine games. The Canadiens prevented the Oilers (26-35-6) from catching them for 28th spot in the NHL standings.

Shawn Horcoff, Linus Omark and Taylor Hall had goals for the Oilers, who have lost four of five.

Tied 2-2 after two periods, the Canadiens took the lead for good three minutes into the third period on the power play when Kaberle picked up a rebound at the side of the net and lifted a shot over goalie Nikolai Khabibulin for his third goal of the season.

Eller made it 4-2 just two minutes later after throwing a puck out from behind the net that caromed in off Khabibulin.

Edmonton got back to within a goal with seven minutes to play. Hall showed patience to wait out a defender before snapping in his 24th goal, and earning his 50th point.

There was a mad scramble in the Canadiens' end in the final minute, and the puck resting on the back of Montreal goalie Peter Budaj's neck at one point before it was cleared. Pacioretty scored his 30th into an empty net with 17 seconds left.

The Oilers' top-ranked power play got them on the board first with eight minutes to play in the opening period when Horcoff tipped a point shot from Corey Potter past Budaj.

The Canadiens tied it with 17 seconds left in the first on a power play when Subban unleashed a shot from the point that got past Khabibulin.

Montreal went ahead 2-1 two minutes into the second period when Scott Gomez swung around the back of the net and put a shot on target. Pacioretty swooped in to score his 29th goal on the rebound.

The Oilers tied it five minutes later after a giveaway in the Montreal zone. Omark took a long shot that clipped a Canadiens defender and deflected in. It was the first goal of the season for the recent AHL call-up.

Montreal appeared to take a 3-2 lead with four minutes to play in the second period when Rene Bourque poked at a puck that Khabibulin had wedged between his skate and the post. The play was ruled a goal on the ice but was reversed upon a video review.

NOTES: It was the second and final meeting of the season between the teams. Edmonton won 3-1 in Montreal in November. ... The Canadiens had lost four consecutive games and eight of nine in Edmonton. They were 0-9 record overall in games in Alberta since the lockout. ... Edmonton's only home win over Montreal in nine games was Nov. 22, 2003, outdoors at Commonwealth Stadium. ... Montreal D Andrei Markov has been cleared for contact but is still out. Gomez returned after missing two games because of injury. ... Montreal lost C David Desharnais to an undisclosed lower body injury. ... Oilers LW Ben Eager sat out because of the flu.