Ryan Johansen tied the game for Nashville (32-12-7) with 42.2 seconds left in the third period, and Pekka Rinne made 24 saves to win his eighth straight start.
With Rinne pulled for an extra skater, Johansen tied it when he gathered P.K. Subban's rebound at the left face-off circle and shot it over Halak's blocker to make it 4-4.
WATCH: [All Predators vs. Islanders highlights]
Josi won it in overtime when he one-timed a cross-ice pass from Nick Bonino shortly after Rinne made a sprawling save against Mathew Barzal.
"You've just got to believe," Johansen said. "Whenever you're playing a good team, you know they're never out of the game, and that's how we feel our opponents look at us and that's how we look at each other in this room. We keep sticking to our game plan.
"It's a game of mistakes, and there are a lot of good players in this league that will make it challenging every night, but with our group and the way we stick to our game plan and just keep coming after teams, there is a big belief in here that we can always get the job done."
Jaroslav Halak made 42 saves for New York (26-22-6), which moved into the second wild card into the Stanley Cup Playoffs from the Eastern Conference, one point ahead of the Philadelphia Flyers.
The Islanders allowed 37 shots on goal through the first two periods before tightening up defensively in the third, giving up only six.
"We didn't deserve it from our first two (periods)," Islanders coach Doug Weight said. "We had the lead, but we're turning pucks over. They have to look at themselves. Thirty-seven shots after two periods… how many of them were from the blue line that hit (Halak) right in the stomach? To me, physically, that means you're not in the shot lane. We don't get those through; they block them.
"We're talking a big game about being aggressive and block shots, but we're not doing it, and that's kind of what our message was. We want to sprint out at those D and not give them time. We were just on our heels and not in shot lanes and the D were soft. They had 10, 12 shot tips. They had zero in the third, and we were aggressive and mad. It was our best period in a long time."
Nick Leddy gave the Islanders a 4-2 lead with a slap shot from the left point at 3:39 of the second period. It was Leddy's second goal in as many games after he went 30 without one.