The Islanders began their grueling run of post All-Star break games by throwing a curveball, putting rookie goaltender J-F Berube in net on Tuesday night against the Minnesota Wild.

Jack Capuano’s surprise move ended up working out, thanks to 40 saves from the 24-year-old goaltender and a barrage of goals in the second and third periods to chase Wild All-Star goalie Devan Dubnyk.

The 5-3 win at Barclays Center was Berube’s first NHL victory and rewarded Capuano’s decision to start his green third-stringer in a crucial game that helped keep the Islanders ahead of the chasing pack for an Eastern Conference playoff spot.

“When we announced (Berube) this morning, a few people looked at me like I head three heads,” Capuano said. “But he played real well last week in Bridgeport, he was ready. He’s part of the team. We have three goaltenders and it’s not going to change. He played great.”

The Wild threw everything on Berube in the first period, recording 20 shots and taking a 1-0 lead on Charlie Coyle’s weak backhand through Berube’s pads. But the Isles, coming off a stretch of two games in 15 days and nothing in the previous week, got themselves in gear in the second.

Mikhail Grabovski snapped one past Dubnyk at 3:20 of the second and Anders Lee tipped Travis Hamonic’s shot home at 5:07 for a 2-1 lead. After a strong period, the Isles gave the lead back on Jason Pominville’s rebound goal at 18:36, only to retake the lead on Brock Nelson’s 20th at 19:18.

advertisement | advertise on newsday

Goals from Frans Nielsen and John Tavares 2:03 apart early in the third period sent Dubnyk to the Minnesota bench and marked the second time in three games the Isles scored five.

“When we put our foot on the gas, when we smell blood like we have lately, you can see it in our play,” said Tavares, who now has five points in his last three games. He had 11 shot attempts Tuesday night. “We should’ve had more tonight.”

Former Islander Nino Niederreiter scored on a power play with 9:56 left and the Wild had another late power-play chance, but Berube was strong.

The young goaltender was claimed off waivers from the Kings at the start of the season, when Jaroslav Halak’s health was in question. But Halak’s return and the strong play of Thomas Greiss meant Berube has been a practice goaltender for the bulk of the season, with the Islanders unwilling to try and pass him through waivers to get playing time in the AHL.

A conditioning stint in November ended quickly with a sprained knee, but Berube went back to Bridgeport the past two weeks and allowed four goals in four victories. On Tuesday, with his mother, grandmother and uncle in attendance from the Montreal suburb of Repentigny, Berube earned his first NHL win in his second start.

“There were a couple times on the bench we were like, ‘Oh, crap, this one’s going in.’ And he made the save,” Hamonic said. “You can tell he’s a confident guy out there, he challenges, he’s really vocal. That can be hard for a young goalie but he handled himself well.”