Claude Giroux and Scott Hartnell also scored for Philadelphia, which ended a six-game road trip with a 5-1 record. Ray Emery made 31 saves and won for the eighth time in nine games.
Michael Ryder tied it at 2 on a short-handed goal with 30 seconds left in regulation. It came on a great feed from defenseman Marek Zidlicky, with goalie Martin Brodeur on the bench for an extra skater.
Adam Henrique also scored for New Jersey, which is 0-2-1 in its last three games.