Colton Sissons and Ryan Johansen each had a goal and an assist for the Predators (15-10-1), who have won three in a row, including the first two of a four-game road trip. David Rittich made 18 saves.
"I give the Islanders credit, that was a hard-fought, physical game," Nashville coach John Hynes said. "I thought both teams played very well. But I think to be able to have that style of game, come from behind twice, down 3-2 with seven minutes left, to tie it and then find a way to win it, you have to be able to find ways to win on the road.
"It was a hard-fought game, tough environment to play in, and our guys stuck with it and got rewarded for it."
Oliver Wahlstrom had two assists for the Islanders (6-11-5), who have lost 12 of their past 13 games (1-9-3) and are 0-5-2 at UBS Arena. Varlamov made 25 saves.
"We've had games in this building that we could've won," New York captain Anders Lee said. "For whatever reason, we haven't closed it out. There's a lot of individual games you look at and how close they were, we come out on the wrong side, and it just happens to be that they're strung together in this building."
Austin Czarnik gave New York a 1-0 lead when he drove the net and one-timed a pass from Wahlstrom at 6:48 of the first period.