It was the third three-goal game of Eberle's career and his first since April 9, 2017, when he was with the Edmonton Oilers.
Anthony Mantha scored for Detroit, which became the first team this season to be eliminated from playoff contention.
"It (stinks) to be in a spot where you are eliminated this early," Detroit's Jeff Blashill said. "It (stinks) and that's a fact."
New York had scored only two goals in its previous four games, but Eberle got hot against the Red Wings, who have yielded more goals than any team in the league.
He got his first 5:45 into the game. The sequence began with a give-and-go behind the net between Matthew Barzal and Anders Lee, who skated to the circle and found an uncovered Ryan Pulock at the point. Eberle redirected Pulock's slap shot past Jonathan Bernier, who made 36 saves.
"We had a ton of chances," Eberle said. "You just have to keep going at it and eventually pucks are going to go in."
New York outshot Detroit 13-2 in the first period and finished the game with a 40-22 advantage in shots.
"Not good enough," Detroit center Frans Nielsen, a former Islander, said of the Red Wings' first period. "We knew they were going to come out hard. Losing four straight and fighting for their (playoff) lives, we knew they were going to be coming."
Varlamov had a relatively easy night. His toughest save was a diving paddle stop on a 3-on-1 in the third period. Mantua's power-play goal with 2:35 left in the game ended the shutout bid.
"He closed quick. I thought he defended well," New York coach Barry Trotz said of Toews. "He did a real solid job."
Minutes later, Eberle scored his second goal, a snap shot from the left circle.
He completed the hat trick on a power play with 36.3 seconds left in the game. Eberle has 13 goals this season.
"The biggest thing is just (to) try to keep going to the areas where you think you can score," Eberle said.
Before the game, the Islanders retired John Tonelli's No. 27. Tonelli was an Islander from 1978-86 and assisted on Bobby Nystrom's Stanley Cup-winning goal 7:11 into overtime of Game 6 against the Flyers in 1980, which began New York's run of four consecutive championships. Among those at the ceremony were teammates Nystrom, Denis Potvin, Billy Smith, and Bryan Trottier; NHL Deputy Commissioner Bill Daly; Islanders co-owners Scott Malkin and Jon Ledecky; and Tonelli's wife Lauren, sons Jordan and Zach, and mother Joy. ... New York called up LW Otto Koivula and LW Andrew Ladd from AHL Bridgeport. ... Detroit scratched Ds Cody Goloubef and Jonathan Ericsson and LW Justin Abdelkader, while the Islanders scratched D Noah Dobson, C Derick Brassard and LW Ross Johnston.
Red Wings: Host Calgary on Sunday.
Islanders: Host San Jose on Sunday.
More AP NHL: https://apnews.com/NHL and https://twitter.com/AP-Sports