Hanifin put the Flames up 4-2 with 14 seconds remaining in the period with a wrist shot through traffic on the power play.
"Something that was good to see, too, is we never really take our foot off the gas pedal," Hanifin said. "Even in the third, we were still trying to make plays. When you have the lead in the third, you don't want to lay off at all, and I think we did a good job of that."
Gaudreau made it 5-2 at 10:01 of the third with the fourth straight Calgary goal.
"I think that was one of our best complete efforts of the season," said Gaudreau, who has scored in two straight games after a 12-game drought. "It was a good game for our team."
Hughes gave New Jersey a 1-0 lead at 15:44 of the first period when he took a stretch pass from Hall, stepped around defenseman Mark Giordano, and deked Rittich.
Hughes has nine points (four goals, five assists) in his past eight games.