The Islanders had a golden chance to get a small measure of revenge Thursday night.

And they failed to take advantage of it, falling to the red-hot Bruins, 5-2, at Barclays Center.

Boston (26-10-8) completed its season sweep of the Islanders (23-20-4), winning all three meetings by a combined score of 13-4.

The Bruins, who got a hat trick from Patrice Bergeron, are riding a league-best 15-game point streak and remain the only Eastern team the Isles have not beaten at Barclays Center, dating to the start of the 2015-16 campaign.

With the Bruins having played the Canadiens on Wednesday and the Islanders seemingly getting a boost from the return of All-Star winger Josh Bailey, this seemed like the perfect opportunity for a change of fortune.

Instead the Islander let an encouraging start go to waste and have now dropped two in a row before heading on the road, where they are just 10-13-1 on the season.

Dazzling rookie Matthew Barzal (48 points) helped provide an early spark, threading the needle on a beautiful feed to Jordan Eberle, who finished the job with his 15th goal of the season at the 7:35 mark of the opening period. The Bruins returned the favor six minutes later, as the 32-year-old Bergeron got his productive night started by firing one past Islanders goalie Jaroslav Halak to make it 1-1.

Though things went downhill from the Islanders from there, with the Bruins seizing a 3-1 advantage in the second period on goals from Ryan Spooner and Bergeron (on the power play), coach Doug Weight said he was impressed with his team’s effort up until the final frame, when the frustration mounted.

“The first two periods were excellent,” he said. “We were physical, we had some really good things we did [Wednesday at practice] and the guys bought in. We lost our way a bit [in the third].”

Several players echoed their coach’s sentiments about the importance of staying composed when adversity strikes. After getting on the board first, the Islanders allowed the Bruins to score four straight goals.

“We felt like the first period was pretty good,” said Bailey, who played his first game since Jan. 5. “We’re playing good teams. If the roles were reversed, we’d be the ones pushing back in the second like they did. So, it’s just finding a way to weather those storms a little bit better.”

Bergeron iced the game in the third, jamming one in the back of the net to finish his hat trick. Captain John Tavares, with an assists from Bailey, tried to breathe a little life into the Islanders with a late goal, his 25th of the season, but it was too little too late.

Marchand scored on an open net to bring make it 5-2.

With the playoff race heating up, and the Islanders still right in the thick of it, Weight was not completely discouraged by the defeat.

He emphasized his players must build on the positive things they did and put together “60-minute” efforts.

“You need to work in this league every shift. The teams that have 60 points and 55 points right now work nine out of 10 shifts in the right way, and we’re doing seven and a half right now,” Weight said. “And it’s a fine line. I’m telling you, we need people to buy in on a 60-minute basis. It’s hard with different lines and different people going in, but you have to do it.”