It shouldn’t have gone to overtime.

The Islanders should have had more than a one-goal lead over the Anaheim Ducks after thoroughly dominating the first period in front of the home fans.

Both are valid points, but ultimately meaningless.

The Islanders needed a win, period, and Josh Bailey’s solo effort through three Ducks and past goaltender John Gibson 54 seconds into overtime gave them what they needed in a 3-2 win Sunday night.

“We honestly felt good about how we played games one and two,” said Cal Clutterbuck, who assisted on Bailey’s winner and John Tavares’ third-period goal. “They were two tough games in tough buildings. But we got to come home and our fans gave us that boost we needed.”

If the sellout crowd at Barclays Center was the cause of the Islanders’ impressive opening 20 minutes, the team may be invincible at home this season. After a modest ceremony before the home opener — the team skated to center ice en masse rather than via individual introductions, as they did the previous two seasons — the Islanders scorched the Ducks.

advertisement | advertise on newsday

The shots were 12-0 at the 12-minute mark. More impressively, the shot attempts were 19-0.

Anaheim didn’t throw any frozen rubber within spitting distance of Jaroslav Halak’s net until almost 14 minutes had elapsed, and only one of the Ducks’ three first-period shots on goal came from inside the Islanders’ zone.

The total first-period shot attempts were 28-5 for the Isles, which included three power plays.

But they held only a one-goal lead, on Brock Nelson’s spin-around shot past Gibson at 7:47 off a feed from Jason Chimera.

“It was definitely weird,” Halak said. “They had no shots and it was because we did a real ly good job, we cycled the puck, we were skating well.”

The script flipped a bit in the second period, with the Islanders giving the Ducks four power plays.Halak made 13 second-period saves and the Islanders blocked 15 shots in front of him, though one of those could be damaging.

Casey Cizikas blocked a point shot with the unprotected back of his leg late in the second. He stayed on the bench and tried to take a shift in the third but ended up in the dressing room for the night.

“We lost Casey at a crucial time in the game,” Jack Capuano said.

The Islanders seemed to seize control in the third period when Tavares followed up his feed for Clutterbuck and buried a second try after Clutterbuck, who had broken his stick on a shot, kicked the puck back to Tavares for a scoring chance. That goal made it 2-0 with 12:01 to go.

But Cam Fowler’s wrist shot deflected off Thomas Hickey’s foot and past Halak 32 seconds later. With the Ducks’ net empty, Ryan Getzlaf tied it with a minute to play on a quick one-timed wrist shot that eluded Halak.

advertisement | advertise on newsday

“It was overall a good game, even though it came down to overtime when it never should have gotten there,” said Halak, who made 24 saves. “We’re glad we got the two points.”