It took a frightening incident and scary injury to finally shake the Wild out of its stupor Tuesday night.

It’s hard to pinpoint why, coach Mike Yeo said, but it’s become common lately to watch the Wild sleepwalk through the start of home games and dig itself a deep, deep hole.

It’s a shame it took Keith Ballard being unconscious and convulsing to elicit such an angry, passionate response. But the Wild, motivated by seeing their teammate in dire straits, stormed back from 3-0 and 4-1 deficits by scoring four times in the third period. Not only did the Wild stun the New York Islanders 5-4, it made a raucous home crowd count down the final seconds of the game as if it were a New Year’s Eve bash.

Mikko Koivu got the comeback started in the third, then Erik Haula and former Islander and Ballard’s close friend, Thomas Vanek, scored 45 seconds apart to tie the score at 4-4. Finally, with 4 minutes, 33 seconds left, former Islander Nino Niederreiter jammed the net looking for a Vanek rebound before banging home the winning goal — his team-leading 12th — on a third whack.

It was the first time in franchise history the Wild rallied from three goals down to win in regulation. The Islanders did the exactly same thing to Minnesota last December in St. Paul.

“With what happened to Keith, it was all pretty sickening to us,” Vanek said. “We took it in a positive way and took the emotion in a good way and started playing real hard. It was a great comeback win for us.”

With the Wild trailing 3-0 (the second consecutive home game and third time in five home games it trailed at least 3-zip), Ballard dumped the puck from the red line as NHL hits leader Matt Martin sped toward him.

After Ballard gave up the puck, he spotted Martin, twisted to dodge the check and turned toward the bench. Ballard was driven face-first into the red dasher on top of the Islanders bench door.

Ballard fell scarily to the ice. Athletic therapist Don Fuller raced to his aid and turned Ballard on his side. Players say Ballard had cuts on his face, appeared unconscious and looked to be convulsing and struggling to breathe. Paramedics raced onto the ice with a stretcher, but after a few minutes, Ballard was helped to his feet and slowly made his way down the tunnel. Ballard, who has a history of concussions, was conscious and taken to Regions Hospital for evaluation and observation.

“Everybody was kind of freaked out about what was going on,” Haula said. “I haven’t ever seen something like that.”

There was no penalty. On the next shift, Mikael Granlund went after Kyle Okposo and drew a retaliatory slashing minor. Jason Pominville scored a power-play goal. Four seconds later, Kyle Brodziak challenged Martin, a tough customer. Brodziak took a beating but earned points from teammates.

“I think that was the turning point for our hockey club,” Koivu said.

“When you see guys band together like that, that’s what we need going forward,” Yeo said.

The Wild buzzed the rest of the period but could have been delivered a dagger when Josh Bailey scored on the Islanders’ only shot of the period. But the Wild dominated the third.

“I’m sure everyone was saying, ‘We’ve got to really play for Keith here,’ ” Haula said.

Koivu cut the deficit to 4-2. Haula ricocheted a puck off an Islanders defenseman to make it 4-3. Then, Vanek crashed the net after a Zach Parise shot en route to the tying goal. Niederreiter scored similarly to make the arena tremble. Ryan Suter, in his first game back from the mumps, had three assists.

Yeo was ecstatic with the win, but mostly, “we needed to respond” after the Ballard incident and another poor start.

“We know we have too much pride and character to allow that to continue, and I thought we showed that the rest of the game,” Yeo said.