Buffalo erased three one-goal deficits to end its slide. The last came after Myers kept the puck in the New York zone and got it to Foligno for a screened shot past Evgeni Nabokov.
Moulson had deflected in Tavares' shot during a power play with 11:16 remaining to put the Islanders ahead 3-2.
Nielsen and Matt Martin also scored for the Islanders (2-2-2), who dropped two on the road before returning home. Nabokov made 31 saves through overtime for New York, which recorded a season-high 44 shots.
The Islanders took a pair of one-goal leads -- one in each of the first two periods -- but Ennis and Vanek both scored in the second to get Buffalo into a 2-2 tie.
"It is a tough way to lose," Martin said. "We had a lot of opportunities to put them away early but we didn't do it."
Nielsen made it 1-0 in the first when he stopped hard in the left circle and snapped a drive past Miller with 6:49 remaining for his third goal.
The first period has proved troublesome for the Sabres all season as they have been outscored 10-1 in the frame and outshot 118-67. New York had a 16-11 edge in shots in the first and outshot Buffalo 32-24 through 40 minutes.
The Islanders hadn't recorded more than 30 shots in their first five games.
"I don't think we let them off," Islanders coach Jack Capuano said. "I thought Ryan Miller made some big saves.
"Tonight was a good game for us. I thought the guys really paid attention to the details the past 48 hours."
Ennis got Buffalo even at 1 with a fortunate goal 5:24 into the second after a shot by Drew Stafford trickled between Nabokov's pads and landed behind him in the blue paint. Ennis swooped in and slammed the puck in for his first of the season.
But New York needed just 2:44 to go back in front when Martin netted his first. Eric Boulton sent a right-to-left pass in front to Casey Cizikas for a shot that was stopped by Miller and knocked behind the net. Cizikas quickly got to it and flung it into the crease to Martin for a redirect.
The Sabres rallied again to tie it 2-2 with a power-play goal after Tavares was sent off for high-sticking. Cody Hodgson sent a pass from the left circle dot in front to Vanek for a quick redirection past Nabokov. It was the third goal this season for Vanek.
Sabres RW Patrick Kaleta received a 10-game suspension from the NHL after an in-person hearing for an illegal check to the head of Columbus Blue Jackets defenseman Jack Johnson last week. Kaleta had already served two games before Tuesday. ... Islanders RW Colin McDonald sat out because of an injured left hip. He is day to day. ... The only time New York has reached 30 shots this season was in a shootout loss to Columbus on Oct. 5. ... Buffalo was 1 for 4 on the power play after going 2 for 25 before Tuesday. ... The Islanders are 1-2 in shootouts. This was Buffalo's first.
Copyright by STATS LLC and The Associated Press
UNIONDALE, NY - OCTOBER 15: Evgeni Nabokov #20 of the New York Islanders protects the net against the Buffalo...