If the Flyers could face the defense-challenged New York Islanders every night, their scoring struggles would surely end.

Michael Raffl, Wayne Simmonds, and Ivan Provorov scored goals in a 4-minute, 48-second span in the second period Thursday, keying the Flyers' 6-4 victory over the Islanders at the Wells Fargo Center.

The Islanders scored a pair of third-period goals to get within 5-4, but Provorov iced the win with an empty-net goal with 12.6 seconds remaining.

The Flyers, who in the first two periods looked quicker and had much more energy than in Tuesday's 5-1 spanking by visiting Pittsburgh, had been averaging just 1.9 goals in their last eight home games.

Provorov collected two goals and an assist as the Flyers handed the Islanders their fourth straight loss. Couturier had a Gordie Howe hat trick — a goal, an assist, and a (winning) fight.

"The game against Pittsburgh wasn't my best," Provorov said. "Those games happen. You have to be able to learn from those and bounce back. We came out with the right mentality tonight."

The Islanders, who scored a pair of overtime wins over the Flyers in November, got to within 5-3 on John Tavares' power-play goal with 13:58 left in the third. About eight minutes later, defenseman Ryan Pulock went around Robert Hagg and fired a shot that went off Brian Elliott and into the net, cutting the deficit to 5-4 with 5:25 to go.

When the Isles pulled their goalie for an extra attacker late in the game, Elliott made a handful of difficult saves to preserve the victory.

"It probably wasn't my best game, but these guys really came out hard," Elliott said after the Flyers inched to within two points of the Islanders. "It was a game we needed to win."

The Flyers controlled the first period and had an 11-6 shots domination, but  they were in a 1-1 tie when the buzzer sounded. It marked the 19th time in the last 20 games they failed to take a lead into the second period.

But they did lots of good things, and their solid play carried into the second period.

"That was part of our game plan," said top-line right winger Travis Konecny, who had a goal and a takedown of Shane Prince after the two squared off in a first-period fight. "We wanted to play hard. We wanted to get back to the way we play hockey. We were getting pucks in, getting on their D and being physical."

Early in the second period, they got goals from Raffl and Simmonds 40 seconds apart to take a 3-1 lead.

Raffl scored on a deflection of Provorov's shot with 18:24 to go in the second, and Simmonds knocked in a rebound for his 13th goal.

Provorov took a slick pass from Nolan Patrick and scored on a long wrist shot while the Flyers were on a power play, giving them a 4-1 cushion with 13:36 to go in the second. Dale Weise set up a screen in front of goalie Thomas Greiss.

After Cal Clutterbuck scored on a rebound, his second goal of the night, Konecny made it 5-2 by scoring on a breakaway with 6:04 to go in the second.  Couturier sprang Konecny with a slick pass, setting up the team's fourth goal in the second.

It marked the third time this season the Flyers had scored four goals in a period. They also scored four second-period goals against the Islanders on Nov. 24 but blew a 4-2 lead and dropped a 5-4 overtime decision.

"I thought it was one of our better periods this season," Raffl said about Thursday's effort.

The 29-year-old winger said the listless loss to Penguins served as a wake-up call.

"Nobody was happy with the way we played against Pittsburgh," he said. "We wanted to come out and redeem ourselves."

They played with an edge. Three players who normally aren't involved in fights — Couturier, Konecny, and Scott Laughton — had bouts.

"Guys were ready from the start, and we responded pretty well from last game," Couturier said.

The Islanders entered the night last in the NHL, allowing 3.58 goals per game.  Greiss has surrendered 29 goals in his last six games.

The Flyers, now 9-8-4 at home, remained four points out of a wild-card spot. They will host St.  Louis on Saturday and Buffalo on Sunday before a mandatory NHL break that will have them off the ice for four days.