Timo Meier and Dawson Mercer each had a goal and an assist, and Jesper Bratt and Luke Hughes each had two assists for the Devils (23-11-3), who are 5-1-0 in their past six games.
"It's good ... we're having fun and we're playing hard," Markstrom said. "You know, it's so much easier to work harder and do stuff in practice, and in the gym, if you're winning hockey games and that's what we're doing right now."
Jack Hughes has 26 points (15 goals, 11 assists) in 22 games against the Rangers, the most among all skaters since he entered the NHL in 2019-20.
"I've had a couple good games against these guys, but it's a great rivalry and whether we're here or at Madison Square Garden, we always get up for these games," Hughes said. "Heading into Christmas break, we wanted to make a statement and have a great game. They came out and wanted to start fast and we matched that energy early."
Jonathan Quick made 24 saves for the Rangers (16-17-1), who are 4-13-0 in their past 17 games. New York is 0-2-0 while being outscored 10-1 against New Jersey this season.
"I thought in the second period, from a 5-on-5 standpoint, we held them in check but didn't generate enough ourselves," Rangers coach Peter Laviolette said. "So, defensively, the last couple games, it's tightened up from a 5-on-5 standpoint, but we're not getting enough looks at what we need in order to be successful offensively."
Chris Kreider was a healthy scratch for New York and replaced by Jonny Brodzinski.
"It was just a lineup decision ... we needed more," Laviolette said.
The Devils went 3-for-4 on the power play. The Rangers were 0-for-4 with three shots on goal with the man-advantage.
Hughes gave the Devils a 1-0 lead at 4:29 of the first period on a wrist shot from the left face-off circle.