It marked the Golden Knights' sixth straight win at home.
Just over a minute after Karlsson skated down the left wing and fired one over Thomas Greiss' shoulder for his team-leading 14th goal at 6:22 to tie the score at 2-all, Reilly Smith - moved down from the top line to the second midway through the second period - fed Stastny, who put it in the open net with his second goal of the season to put Vegas ahead 3-2.
''He's easy to play with, he holds on to the puck, buys you that extra second to get open,'' said Stastny, who has two goals and an assist in the last three games. ''When you play with good players it doesn't matter. I think a good coach will do a good job of switching two guys that will give a spark to two lines.''
Defenseman Nate Schmidt had an empty-net goal and two assists and Brandon Pirri, also on the second line, scored as Vegas came back from two goals down near the midpoint of the second period. Fleury, who made 19 saves, picked up his league-leading 20th win of the season. He also broke a tie with Tony Esposito to take sole possession of ninth place on the career list, moving 13 victories behind Jacques Plante (437).
''The second period we knew they were going to have a push,'' Islanders coach Barry Trotz said. ''I would say we weren't as committed as we were in the first, and their commitment level got raised and they got a lot of momentum.''
Smith, who leads the team with 18 assists, said he was fine with coach Gerard Gallant's line move, especially since he's played with Pirri since their childhood days in Toronto, and skated with Stastny during training camp.
''Two easy guys to play with,'' Smith said. ''Stas is a smart player and he'll find openings and make a lot of nifty plays out there. I've been playing with Pirri since I was 8 years old, so there's a lot of chemistry between us two. It's nice, if you're shuffling lines, to be able to play with somebody you're so familiar with. I think we played with a lot of energy and created a lot of offense.''
The Golden Knights, who completed a season series sweep of the Islanders after losing both matchups last year, are 6-3-1 in December and hold the top wild card spot in the Western Conference with 42 points.
''I liked our game; we kind of fell asleep for a minute and a half late in the first period and it cost us two goals, and we were disappointed with that,'' Gallant said. ''But I thought overall we played a real good solid game and lots of scoring opportunities. The second period was real good for us.''
Trailing 2-0 after one period, the Golden Knights cut the deficit in half near the midpoint of the second. Pirri, who was called up from Chicago of the AHL on Wednesday, cleaned up a rebound in the crease with backhand over Greiss' pads at 8:48. In three career games with the Golden Knights, Pirri has four goals.
''I got to witness some playoff games last year and this building is pretty electric,'' Pirri said. ''So when you get this opportunity you want to make the most of it. After I scored it was pretty loud, so it was pretty fun.''
Schmidt's empty-net goal with 15 seconds left provided the final margin.
Barzal gave the Islanders a 1-0 lead with 1:30 left in the first period, and Nelson doubled it just 1:08 later.
NOTES: Vegas D Colin Miller (undisclosed injury) was out for the first time since the Golden Knights joined the league last season. Karlsson is the only player to appear in all of the second-year franchise's games. ... Of Pirri's 61 career goals, 19 of them have come on the power play. ... Luca Sbisa, who played 30 games with Vegas last season, returned to T-Mobile Arena for the first time as an Islander.
Islanders: At Dallas on Sunday.
Golden Knights: Host Montreal on Saturday.
More AP NHL: https://apnews.com/NHL and https://twitter.com/AP-Sports
Copyright 2018 by AP. Any commercial use or distribution without the express written consent of AP is strictly prohibited.