Jesper Bratt had two assists, and Jacob Markstrom made 21 saves for the Devils (38-28-7), who had lost three straight (0-2-1) and moved nine points ahead of the New York Islanders for third place in the Metropolitan Division.
Spencer Knight made 15 saves for the Blackhawks (21-42-9), who have lost eight of nine (1-7-1). Artyom Levshunov had two assists.
Nathan Bastian gave the Devils a 1-0 lead at 6:23 of the first period when he tipped in a centering pass from Hughes at the top of the crease.
Timo Meier made it 2-0 on the power play at 6:50. Mercer got the puck along the goal line and put a shot on net, which was knocked down in front but stuffed in by Meier.
Tyler Bertuzzi scored for the Blackhawks to cut the lead to 2-1 at 9:06 on the power play. After Levshunov dove to keep the puck in at the blue line, Ryan Donato drove through the right circle and fed Bertuzzi for a tap in at the left post.
Ondrej Palat made it 3-1 at 3:14 of the second period with a short-handed goal, taking a drop pass from Jesper Bratt in the right circle and scoring with a wrist shot.
Ilya Mikheyev brought Chicago within 3-2 at 5:26, scoring from the slot after taking a backhanded pass from Teuvo Teravainen.
Donato appeared to tie the game at 6:17, but the goal was disallowed after video review determined his stick was over the crossbar on a tip-in attempt.
Mercer’s power-play goal at 11:01 restored New Jersey’s two-goal lead. After taking a pass from Hughes, Mercer scored on a wrist shot from the left circle to make it 4-2.
Frank Nazar cut the lead to 4-3 at 17:10 of the third period, finishing a rebound in front with Knight on the bench for an extra attacker.
Stefan Noesen scored an empty-net goal for the 5-3 final at 19:47.