Brayden Schenn went from second-line right wing to first-line left wing on a unit with Claude Giroux and Wayne Simmonds. Jake Voracek dropped from the first line to the second line, which included Nick Cousins and R.J. Umberger.
Schenn, Simmonds and Giroux combined for two goals and eight points, while Cousins, Umberger and Voracek combined for two goals and four points.
Michael Raffl centered the third line, with Matt Read and Sam Gagner.
Hakstol said that with three games left on the five-game road trip after Tuesday, it was a good time to make changes.
"There's a lot of pieces to it," he said, "but it's the right time to do it."
The Flyers had been getting production from just the top line lately. In their last five losses, they averaged just 1.4 goals per game.
We were working well tonight," Simmonds said after changes aided the win. "Coach has a feel for the game because it definitely worked."
Center Jordan Weal, who had played just three games since being acquired from the Los Angeles Kings, suffered an on-ice injury after the morning skate and will miss at least three weeks, general manager Ron Hextall said.
Hextall said the Flyers will learn Wednesday whether surgery is required.
Sean Couturier (foot/ankle) is making progress and may return to the lineup ahead of schedule, Hextall said. He had been expected to return in about two weeks.
Hextall did not sound as optimistic about injured defenseman Michael Del Zotto, who could be sidelined for a long time.
Shayne Gostisbehere extended his scoring streak to 13 games. The streak is a rookie record for NHL defensemen. The overall rookie record is 20 games by Paul Stastny in 2006-07.
"I'm very proud of it, but it's not something that's first on my mind," Gostisbehere said. "We're in a tough playoff push now. . . . and we have to win games right now. That's the main focus of our team: Have good team play and whatever comes along with it is cool, but the main focus is the playoffs."
Scott Laughton and Brandon Manning (plus-5) were healthy scratches. . . . The Devils wore their retro red-and-green jerseys. . . . Rick Tocchet has the only hat trick against New Jersey in Flyers history. He did it on Nov. 20, 1988, at the Spectrum.