NEW YORK (AP) — After a sluggish start, the New York Islanders picked up their intensity in the second period and got a needed victory.

Brock Nelson and Matt Martin scored 21 seconds apart in the second and the Islanders beat the Ottawa Senators 3-1 Wednesday night to snap a season-high four-game losing streak (0-3-1).

John Tavares also scored in New York's three-goal second period and rookie goalie Jean-Francois Berube, making just his fourth career start, stopped 22 shots.

"We executed well," Tavares said. "(Berube) was great all game. He was really big for us. He really did a solid job back there."

New York, holding the first wild-card spot in the Eastern Conference, was desperate for a win to strengthen its playoff push after going 1-4-2 in its previous seven games while getting outscored 22-11.

The Islanders pulled within one point of Pittsburgh for third place in the Metropolitan Division and moved four points ahead of Philadelphia and Detroit, who are tied for the East's second and final wild card.

"We're getting ready for the playoffs and obviously we want to get in with good momentum," Berube said. "This is a huge win for us. We put some pucks in the net."

Berube got his second start in nine days to give Thomas Greiss a rest. With starting goalie Jaroslav Halak out for at least the rest of the regular season, Greiss — who has already appeared in a career-high 35 games — is 1-4-1 with a 3.34 GAA in his absence.

Berube made several big saves, including two on one sequence about 6 1/2 minutes into the game, Ottawa's Mark Stone got the puck to Jean-Gabriel Pageau ahead on a rush and Berube slid across to stop his shot.

The rebound came to the left and as Stone swept in, Berube dove across the goal and stopped the puck with his glove.

"It was a big save," Islanders coach Jack Capuano said. "It could have been the turning point of the game. You need your goalie to make big saves. He competed hard. He battled for his space."

Stone scored and Andrew Hammond finished with 20 saves for Ottawa, which lost its second straight after winning three of four.

"I thought we had a lot of perimeter shots, maybe not enough traffic in front," said Ottawa's Bobby Ryan, who played in his 600th game. "We had a few scrums at some point during the game, but definitely not enough."

Stone spoiled Berube's shutout bid at 6:21 of the third period as he took a pass from Erik Karlsson on a 2-on-1 break and scored on a backhand. It was Karlsson's NHL-leading 62nd assist and he is fourth in the NHL with 75 points.

"I thought we came out pretty well, pushed the pace, didn't really give them much room to move," Stone said. "It's just a tough little stretch there that cost us."

The Islanders got on the scoreboard early in the second period. After Tavares won a faceoff in the offensive zone, Calvin de Haan got the puck and sent it to Josh Bailey, who fired a shot from inside the blue line. Hammond stopped it, but the rebound went to Tavares in front and he backhanded the puck in at 5:24 for his 27th of the season.

New York doubled its lead with 5:32 remaining in the period as Travis Hamonic took a shot from the right side and Martin, streaking across the front of the goal, deflected it past Hammond.

Nelson made it 3-0 just 21 seconds later as got a quick pass from Shane Prince from behind the net and fired it past Hammond from the right side in front for his 24th.

Senators coach Dave Cameron challenged the play to see if the Islanders were offside when they entered the offensive zone, but the goal was upheld after a video review.

NOTES: The Senators were without D Dion Phaneuf, who did not travel to New York with the team after suffering a lower-body injury in a 4-2 loss at home to Washington on Tuesday. ... Ottawa was 0 for 1 on the power play and has not scored in 28 chances over their past 11 games. ... The Senators closed their 13th set of back-to-back games this season. They are 7-6 in the first games, and 3-10 on the back end. ... Stone has a team-high 32 points (nine goals, 23 assists) in road games. .... Tavares has six goals and seven assists in his past 10 home games. ... LW Prince played against the Senators for the first time since being traded to the Islanders in a trade-deadline deal. Prince, who spent six seasons in the Ottawa organization, has a goal and an assist in 11 games with New York. ... The Islanders announced they have agreed to a three-year entry-level contract with G Eamon McAdam, the team's third-round pick in the 2013 draft.