DETROIT -- Brock Nelson scored twice to help the New York Islanders end the Detroit Red Wings’ six-game winning streak with a 5-3 victory at Little Caesars Arena on Thursday.

Mathew Barzal had the go-ahead goal and an assist in the third period for the Islanders (25-20-14), who won their second straight game after losing five of six. Ilya Sorokin made 23 saves.

“This has been a good road trip,” said New York coach Patrick Roy, whose team won 3-2 in overtime at the Dallas Stars on Monday to open the two-game trip. “Dallas is not an easy place to play, and it is the same thing here. They are fast teams that move the puck well. This gives us something to build off going home.”

Olli Maatta scored twice for the Red Wings (33-21-6), who hadn’t lost since Feb. 15 (4-1 at the Vancouver Canucks). Alex Lyon made 22 saves.

“I think the difference in this game was our intensity to start the game,” Detroit coach Derek Lalonde said. “If we had started the first period with the same intensity we had in the second period, we would have been playing from the lead all night instead of chasing the game.”

NYI@DET: Nelson forces the turnover and sends it into the twine

Nelson gave the Islanders a 1-0 lead at 12:11 of the first period, stealing the puck from Ben Chiarot and shooting past Lyon from the low slot.

Casey Cizikas made it 2-0 at 16:18, deflecting Adam Pelech’s shot past Lyon.

Maatta cut it to 2-1 at 5:04 of the second with a slap shot from the left circle.

Patrick Kane tied it 2-2 10 seconds into the third period, extending his point streak to 10 games (15 points; six goals, nine assists).

“Everyone makes a big deal about letting leads go, but it happens when you have leads,” Roy said. “A one-goal lead in this league is nothing. Even a two-goal lead in this league is nothing.”

Nelson put the Islanders back ahead 3-2 at 5:04 with a power-play goal from the bottom of the right circle.

Maatta scored his second of the game to tie it 3-3 at 10:49, shooting into an open net off a cross-ice pass from Shayne Gostisbehere. It was Maatta’s third multigoal game in the NHL (March 1, 2018, against the Boston Bruins and March 6, 2014 against the San Jose Sharks).

“I think we’re doing a really good job of using our defensemen in a five-man unit to get them some chances,” Maatta said. “[David Perron] made a great pass to get me the puck for the first one, and [Gostisbehere] made a great pass for the second one.”

Barzal gave New York a 4-3 lead at 13:58 when his shot from a sharp angle banked in off Lyon.

“I think this has to go down as a disappointing missed opportunity,” Lalonde said. “We had the game tied twice in the third period and didn’t get a point. The Islanders are too good of a team to give them 20 minutes like we did in the first period.”

NYI@DET: Barzal redirects it off the goalie and into the back of the net

Pierre Engvall made it 5-3 with an empty-net goal at 19:24. It was the first empty-net goal of the season for the Islanders, who were the only team without one.

“This was such a big game for us,” Barzal said. “It was nice to get the [empty-net goal] to put an exclamation point on it instead of having to grind out the last 30 seconds.”

NOTES: Nelson had his 35th multigoal game in the NHL, passing Ziggy Palffy for ninth-most in Islanders history. … Sorokin earned his 89th NHL win and passed Jaroslav Halak for sixth-most in franchise history. … Noah Dobson got his 54th assist of the season and tied Denis Potvin (1982-83) for the 10th-most in a season among defensemen in Islanders history.