Dawson Mercer and Cody Glass also scored, and Jack Hughes and Connor Brown each had two assists for the Devils (30-29-2), who have won two straight after five losses in a row. Jacob Markstrom made 20 saves.
Anton Lundell scored for the Panthers (30-28-3), who have lost three of four since the Olympic break and are 2-8-0 in their past 10 overall. Sergei Bobrovsky made 28 saves.
Florida closes out a four-game road trip at the Columbus Blue Jackets on Thursday and at the Detroit Red Wings on Friday. The Panthers play 13 of their next 19 games on the road.
Arseny Gritsyuk gave New Jersey a 1-0 lead at 12:10 of the first period on a snap shot from the left hash marks off a 2-on-1 with Jack Hughes, who extended his point streak to four games (five assists).
Lundell tied it 1-1 at 14:37 on a backhand from the slot just eight seconds after a power-play expired.
Hamilton gave the Devils a 2-1 lead during a 4-on-4 at 1:35 of the second period. Jack Hughes took the initial shot from the left circle that caromed off the end boards to
Hamilton low in the right circle.
Glass pushed it to 3-1 at 8:13 on a highlight-reel tip-in just outside the right post.
Mercer scored an empty-net goal at 16:23 of the third period to make it 4-1, and Simon Nemec also scored into an empty net at 19:20 for the 5-1 final.