PHILADELPHIA -- Jaromir Jagr said one of the most important lessons he learned from his father was to always keep skating. He heeded those lessons Tuesday, scoring the game-winning goal in the third period to lift the New Jersey Devils to a 2-1 win against the Philadelphia Flyers at Wells Fargo Center.

Jagr also had an assist, Travis Zajac had a goal, and Tuomo Ruutu had two assists for New Jersey. Martin Brodeur stopped 30 shots as New Jersey won its second straight game to move within two points of the Flyers for the final wild-card spot in the Eastern Conference.

The game was tied 1-1 in the third when New Jersey cycled the puck down low on the right side of the Philadelphia zone. Marek Zidlicky carried the puck below the goal line and made a nifty backhand pass to Jagr, who outmuscled defenseman Mark Streit on the goal post to flip the puck over Mason's blocker at 7:42.

"We were in the offensive zone I would say 30 seconds," Jagr said. "All you have to do is keep skating. Even if you're tired you have to keep skating, no matter what. I know how tough it is when you have to play defense against somebody who skates all the time in the offensive zone and you're tired. My dad always told me you have to keep moving in the offensive zone. Everyone's watching you, [and] that's what he did. Something always opens up, some good play. ... That's what happened. We controlled the puck for a long time, they got tired and [we got a] lucky break. But I think because he was skating a lot it created the chances."

The goal was Jagr's 21st of the season. He also added an assist for his 17th multipoint game of the season and extended his point streak to four games. With 1,745 points, Jagr moved within 10 of Steve Yzerman for sixth on the all-time list. His 702 goals are six behind Mike Gartner for sixth all-time.

He's also averaging 19:00 ice time per game, more than he's played since he returned to the NHL for the 2011-12 season. At age 42, Jagr credits his expanded playing time as much as anything else for his strong play this season.

"I play a lot more than I did before," Jagr said. "I think I have a little bit bigger role than I had here in Philly. ... You've got to grab the opportunity. But first you've got to get a chance. I got a chance to play, and now it's up to me. It's an advantage, and I take it."

"He's done well," Brodeur said of Jagr. "He's a guy that puts himself in position to be successful. He's around the net, he controls the puck, he plays the game the right way. He's been given the opportunity to play good, quality minutes, and that helps him because it gives him a little more life than with other teams he played with before the last few years. He was never the center; now he is. He's a big part of our success."

Brodeur, 41, also was a big part of the Devils' success Tuesday. Starting back-to-back games for the first time since Dec. 31 and Jan. 3, Brodeur played one of his better games of the season, making almost every save and backstopping a penalty-killing unit that shut down Philadelphia on six chances.

"It was a typical Devils-Flyers game," Brodeur said. "Had a good atmosphere, lot of physical play around the net, throwing pucks from everywhere. Enjoyable game. Always nicer when you finish on top, but it was a fun game to play."

The physical play changed the course of the game in the final minute. With the Flyers trailing 2-1 and pushing for the tying goal, Philadelphia shoved a puck under Brodeur with 40.1 seconds remaining, but the goal immediately was waved off when officials ruled Scott Hartnell pushed Brodeur across the goal line with the puck. The referee consulted with the NHL Situation Room in Toronto, but that call is not reviewable.

"I'm sure anybody from the Flyers' side doesn't think it was the right call," Brodeur said. "As a goalie I think it's something that you make a save and you don't want nobody to push you to put the puck in the net at the same time. I'm not saying he did it purposely. I think his momentum threw him into me."

The Flyers certainly disagreed, but coach Craig Berube felt the game never should have come down to one play in the final seconds of regulation.

"I thought during the first period and third period our power play looked good," Berbue said. "We shot the puck, had some good looks. Second period, not so good, but six power plays, you've got to make it happen."

Their final power-play chance came with 4:20 left in the third when Jagr was called for hooking, but Brodeur made three saves, including a stop on a point shot by Kimmo Timonen and a denial of Wayne Simmonds from the crease on the rebound.

That left the Flyers frustrated on a night when they saw themselves slip from third place in the Metropolitan Division into the group of teams fighting for one of the two wild-card spots in the conference.

"I think we did a good job playing in their zone, but we could've shot more pucks, I think," Flyers captain Claude Giroux said. "We passed up a lot of chances to shoot the puck. We tried some cross-ice passes. They're a good team defensively. We needed to get the puck on the net more."

New Jersey opened the scoring at 7:56 of the first period on Zajac's 12th goal. New Jersey was cycling the puck deep on the left side of the Philadelphia zone when Zajac pulled it out of the corner and sent it to Jagr in the left circle. Jagr one-timed a return pass to Zajac, who got a step on Brayden Schenn and went to the net. Zajac patiently skated through the crease and waited for Mason to go down and then shot it over him from a sharp angle.

The Flyers tied the game 47 seconds into the second period on Grossmann's first goal in 75 games. Giroux won a faceoff in the New Jersey end and Jakub Voracek fired a shot from the right side that went well wide of the net. The puck rolled to Grossmann along the wall on the left side of the New Jersey zone, and he fired what looked like a harmless wrist shot on net that squirted between Brodeur's pads.

"It was a bad goal," Brodeur said. "I wasn't ready for it. I wasn't ready on the faceoff, and so I got my head up and Voracek shot it, and I shook my head because I wasn't ready and because of that I wasn't ready for the second shot."

Grossmann's goal was his first since Feb. 20, 2013, against the Pittsburgh Penguins. It also gave him 12 points on the season, tying his personal best.

It was the only goal of a period that saw Philadelphia carry the play. After getting two even-strength shots in the first, they had 11 in the second.

Zajac's goal came during a 20-minute stretch that saw New Jersey dominate play. The Devils limited the Flyers to six shots, two at even strength. They also held Philadelphia without a shot for an 8:43 span in the second half of the period.