Anders Lee scored twice, and Mathew Barzal had two assists for the Islanders (5-3-2), whose seven-game point streak ended (5-0-2).
"I just thought they came into the third with a little more jump," New York defenseman Zdeno Chara said. "They were playing a little bit more on their toes. I think we were just kind of sitting on that lead and not playing the way we're capable of."
Hartman tied it 2-2 on a rebound from an angle at 7:17 of the third period, and Duhaime gave Minnesota a 3-2 lead at 9:18 with a shot from atop the circles.
Jonas Brodin (18:13) and Matt Dumba (19:11) each scored an empty-net goal for the 5-2 final.
Hartman, who leads the Wild with six goals, has scored five points (four goals, one assist) in his past five games.
"It's the first 11 games and there's still a lot of hockey," Hartman said. "Obviously, I'd like to continue to do this and I'm going to strive to do that, but we've got a lot of guys that can do it as well and we're getting scoring from up and down our lineup, so it's been good for us."
Lee gave the Islanders a 1-0 lead at 19:41 of the first period on a rebound of Chara's shot during a delayed penalty.
Varlamov saved all 14 shots he faced in the first.
"[Varlamov] was definitely up to the task," Barzal said. "It was nice to see him back, doing his thing in net. Obviously, he's a guy that everyone loves in the locker room and he works extremely hard off the ice, and it was great to see him back after I know he worked really hard during his rehab."
Nick Bjugstad tied it 1-1 on a redirection of Duhaime's shot at 9:59 of the second period.
Lee scored again at 12:04 when he finished a 2-on-1 with Barzal to give New York a 2-1 lead.