Hartnell's second man-advantage marker came on a blazing one-timer from the left circle off a feed from Claude Giroux. The tally gave Philadelphia a 3-1 lead 8 minutes into the third period.
Hartnell also scored in the middle frame, as did the Flyers' Matt Read, while Wayne Simmons added an empty-netter as Philadelphia rebounded from a Thursday loss to the last-place New York Islanders.
Ilya Bryzgalov earned the victory by stopping 30-of-31 shots, including 14-of-15 in a busy second period.
Alexei Ponikarovsky, acquired by the Devils from Carolina Friday, netted his first goal for New Jersey.
Martin Brodeur finished with 16 saves in the loss.