Travis Zajac had the other goal for New Jersey (29-24-13), which won for the fifth in seven games to move within two points of the third-place Flyers in the tightly bunched Metropolitan Division.
Adam Henrique was held in check by the Flyers, and his six-game goal streak was snapped. Henrique had nine goals and two assists during that run.
Nicklas Grossman scored for the Flyers (33-25-7), who are 7-2-1 in their last 10 games. Philadelphia had a potential tying goal by Scott Hartnell disallowed by officials with 40.1 seconds remaining because it was determined that Hartnell pushed goalie Martin Brodeur into the net.
Marek Zidlicky set up Jagr for the decisive goal with a backhanded pass from behind the net. Jagr lifted it off goalie Steve Mason and just inside the near post from close range to put New Jersey ahead 2-1 with 12:18 left.
It was the 21st goal of the season and sixth game-winning tally for Jagr, who is the NHL's career leader with 124. It also marked the 702nd career goal for the 42-year-old New Jersey forward, who earlier this season became the seventh player to score 700 NHL goals.
Jagr, a former Flyers player, is no stranger to success against Philadelphia. He raised his career total to 102 points in 90 career games versus the Flyers.
Zajac opened the scoring 7:56 in when he beat Mason top shelf from a difficult angle after getting the Flyers goalie to sprawl on the ice following a deke in front. It was Zajac's 12th goal this season.
Grossmann tied it 47 seconds into the second period with a rare soft goal allowed by Brodeur. Grossmann whirled and wristed a shot from the side boards near the Flyers' bench. Brodeur misplayed the puck, and it went between his legs.
Brodeur was solid otherwise, making 30 saves to improve to 50-31-10 against Philadelphia.
Mason fell to 0-4 against the Devils.
NOTES: Grossmann last scored on Feb. 20 of last season. . Flyers center Zac Rinaldo (upper body injury) sat out. He is day-to-day. ... Backup Philadelphia goalie Ray Emery (lower body injury) didn't play despite practicing on Monday. Emery hasn't played since being injured on Feb. 27. ... New Jersey went 2-1-1 against Philadelphia this season.