This was a game that teetered on the brink of disaster all night, as the Islanders spent significant portions of time staring at the most disheartening of outcomes.

And it wasn’t until the final horn sounded that it all seemed real, that Saturday night’s 5-4 shootout win over the Red Wings at the Coliseum had actually happened. But it wasn’t without a touch of bad news, as goalie Evgeni Nabokov left the game with a groin injury 4:12 into the first period, after giving up a goal on the first shot he faced.

Coach Jack Capuano said the 38-year-old Nabokov will be reevaluated on Monday, but he is expecting him to miss “a couple weeks, for sure.”

Nabokov was replaced for the remainder of the game by Kevin Poulin, who started the season as the presumed backup but had earned his way into the previous three straight starts.

And the 23-year-old netminder held his own in this one — including making all three saves in the shootout — allowing Frans Nielsen’s lone tally in the skills competition give the Islanders (8-10-3) the much-needed two points.

“I thought he played excellent,” Capuano said of Poulin, who made 19 saves in 49:50 of time, then stopped an unbelievably talented trio of Henrik Zetterberg, Pavel Datsyuk and Todd Bertuzzi in the shootout, handing the Red Wings (9-6-6) their sixth loss in a row, and fifth straight in a shootout or overtime. “With Nabby probably being out for a little bit of time, it’s good to see him come in a play confident.”

The Islanders had played a solid game all around, yet continually found a way to crumble just at the most precious of moments. When Pierre-Marc Bouchard gave them a 4-3 lead early in the third, it was erased with just 42.5 seconds remaining, as Datsyuk tossed a backhand to the net that banked in off a sprawled-out Andrew MacDonald to tie it.