NEWARK, N.J. (AP) — Patrik Elias scored his eighth career hat and the New Jersey Devils kept their faint playoff hopes alive with a 4-2 victory over the Philadelphia Flyers on Friday night.

Brian Rolston set up all three goals by Elias, rookie Nick Palmieri got the winner midway through the third period and Johan Hedberg made 34 saves in what was a must-win game for the Devils.

READ MORE: Pennsauken Police Searching For Hit-And-Run Driver Who Killed Shadid Fauntleroy While Crossing Route 130

New Jersey has to win its final five games and get a lot of help or it will miss the playoffs for the first time since 1996.

James Van Riemsdyk and Jeff Carter scored for the Eastern Conference-leading Flyers, who have lost two in a row and three of four. Brian Boucher made 20 saves for Philadelphia.

After Carter tied tit at 2 early in the third period, the Devils put the game away with two goals that went into the net off skates and had to survive reviews.

Palmieri got the winner with 11:05 to play by simply being in the right spot at the right time. Ilya Kovalchuk carried the puck into the Flyers’ zone, skated to the middle and tried to hit the rookie with a pass. The puck hit off the toe of Palmieri’s skate and into the net, promoting Boucher to wave his arms in protest. The goal stood.

Elias finished off his hat trick with another lucky bounce. Rolston took a shot from the right circle that Boucher stopped. The rebound went out in front and hit off the skate of Elias and also went in.

After the fans threw their hats on the ice, the play was reviewed. The goal also stood.

READ MORE: Upper Darby Mayor Unveils Plan To Resolve Battle Over Control Of Summer Stage

Carter tied it at 4:18 of the period, slam-dunking a pass from the goal line by Nikolay Zherdev.

Rolston made two perfect passes to set up Elias and keep the Devils’ season alive.

With the Devils trailing 1-0, Rolston carried the puck from center ice to deep into the Flyers’ zone and found Elias between the circles for a one-timer that beat Boucher into the corner of the net.

With the Flyers on a power play a little more than a minute later, Elias stopped the puck along sideboards in his own zone and gave the puck to Rolston. The two quickly skated out of the zone on a 2-on-1 break and Rolston slid a pass between Van Riemsdyk’s legs to Elias, who roofed a shot with Boucher guarding the lower half of the net.

Van Riemsdyk, who scored his first career hat trick last weekend, gave the Flyers a 1-0 lead in the first period with his 20th goal of the season. Mike Richards set up the goal with a pass from deep in the right cirlce into the crease that either deflected off the second-year player into the net at 10:50.

NOTES: The Flyers are 16-4-2 against Atlantic Division foes. … Goaltender Martin Brodeur did not start for the Devils for the first time in 16 games. … The Devils’ Colin White missed his third straight game with a lower-body injury, while fellow defenseman Anton Volchenkov returned to action after missing two games because of the same type of injury.

MORE NEWS: Man Robs 16-Year-Old Girl At Knifepoint At SEPTA Station, Police Say

© 2011 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed. Learn more about our Privacy Policy and Terms of Use.