Josh Bailey had a goal and two assists, Thomas Greiss stopped 40 shots, and the New York Islanders held on to beat the rival New York Rangers 4-2 Tuesday night.

Anders Lee, Anthony Beauvillier and Brock Nelson also scored, and Mathew Barzal had two assists to help the Islanders head into the All-Star break with their second win in eight games (2-4-2). The Islanders got their first win against the Rangers in the teams’ third meeting in nine days.

More Images
New York Islanders' Brock Nelson (29) celebrates with teammates after scoring a goal as New York Rangers' Jacob Trouba (8) and Pavel Buchnevich (89) react during the third period of an NHL hockey game Tuesday, Jan. 21, 2020, in New York. The Islanders won 4-2. (AP PhotoFrank Franklin II)

Josh Bailey had a goal and two assists, Thomas Greiss stopped 40 shots, and the New York Islanders held on to beat the rival New York Rangers 4-2 Tuesday night.

New York Islanders' Anders Lee (27) celebrates with teammates after scoring during the second period of an NHL hockey game against the New York Rangers Tuesday, Jan. 21, 2020, in New York. (AP PhotoFrank Franklin II)

Pavel Buchevich and Chris Kreider scored power-play goals 1:47 apart late in the third period for the short-handed Rangers. Alexandar Georgiev, who came in 4-1-0 in five games against the Islanders, finished with 14 saves.

New York Islanders' Anders Lee (27) celebrates with teammates after scoring a goal during the second period of an NHL hockey game against the New York Rangers Tuesday, Jan. 21, 2020, in New York. (AP PhotoFrank Franklin II)

Nelson scored from the left side off a nice pass from Bailey to make it 4-0 at 3:13 of the third. It was Nelson’s 20th of the season.

New York Rangers goaltender Alexandar Georgiev, right, stops a shot on goal by New York Islanders' Mathew Barzal during the second period of an NHL hockey game Tuesday, Jan. 21, 2020, in New York. (AP PhotoFrank Franklin II)

With the Rangers still on the power play and the goalie pulled for a 6-on-4 advantage, Kreider scored on the rebound of Mika Zibanejad's shot to make it 4-2 with 4:28 to go. It was Kreider's 17th.

New York Rangers goaltender Alexandar Georgiev (40) watches a puck shot by New York Islanders' Brock Nelson for a goal during the third period of an NHL hockey game Tuesday, Jan. 21, 2020, in New York. The Islanders won 4-2. (AP PhotoFrank Franklin II)

Lee fired a one-timer off a pass from Barzal past Georgiev for his 16th at 9:52 of the second for a 3-0 lead. The puck appeared to deflect in off the Rangers’ Ryan Lindgren, the second time in the game a goal was scored off the defenseman.

New York Islanders goaltender Thomas Greiss (1) defends his net from New York Rangers' Ryan Strome (16) during the first period of an NHL hockey game Tuesday, Jan. 21, 2020, in New York. (AP PhotoFrank Franklin II)

The Rangers also controlled play for much of the first 12 minutes of the game. Greiss made several nice stops to keep the Rangers off the scoreboard, including a stellar save on a slap shot by Buchnevich with 8:34 left.

New York Islanders goaltender Thomas Greiss stops a shot on goal by New York Rangers' Brett Howden, left, during the second period of an NHL hockey game Tuesday, Jan. 21, 2020, in New York. (AP PhotoFrank Franklin II)

The Islanders were on another power play as Beauvillier got the puck from Barzal high between the circles, skated forward and fired the puck past Georgiev for his 18th with 3:25 left in the period to make it 2-0.

Greiss improved to 5-0-1 in eight career games against the Rangers.

New York Islanders' Brock Nelson (29) celebrates with teammates after scoring a goal as New York Rangers' Jacob Trouba (8) and Pavel Buchnevich (89) react during the third period of an NHL hockey game Tuesday, Jan. 21, 2020, in New York. The Islanders won 4-2. (AP PhotoFrank Franklin II)

New York Islanders' Brock Nelson (29) celebrates with teammates after scoring a goal as New York Rangers' Jacob Trouba (8) and Pavel Buchnevich (89) react during the third period of an NHL hockey game Tuesday, Jan. 21, 2020, in New York. The Islanders won 4-2. (AP PhotoFrank Franklin II)

Pavel Buchevich and Chris Kreider scored power-play goals 1:47 apart late in the third period for the short-handed Rangers. Alexandar Georgiev, who came in 4-1-0 in five games against the Islanders, finished with 14 saves.

The Rangers were without All-Star forward Artemi Panarin, who sat out with an upper body injury. Brendan Lemieux took his spot on the top line to start the game.

The Islanders, 2 for 29 on the power play over their previous 14 games, were 2 for 2 against the Rangers.

New York Islanders' Anders Lee (27) celebrates with teammates after scoring during the second period of an NHL hockey game against the New York Rangers Tuesday, Jan. 21, 2020, in New York. (AP PhotoFrank Franklin II)

New York Islanders' Anders Lee (27) celebrates with teammates after scoring during the second period of an NHL hockey game against the New York Rangers Tuesday, Jan. 21, 2020, in New York. (AP PhotoFrank Franklin II)

Nelson scored from the left side off a nice pass from Bailey to make it 4-0 at 3:13 of the third. It was Nelson’s 20th of the season.

Lemieux hit a goalpost a little more than a minute later, keeping the Rangers off the scoreboard.

However, shortly after Islanders defenseman Scott Mayfield was whistled for a double-minor for spearing Lemieux, Buchnevich scored on a deflection to get the Rangers on the board with 6:15 left. It was Buchnevich's eighth.

New York Islanders' Anders Lee (27) celebrates with teammates after scoring a goal during the second period of an NHL hockey game against the New York Rangers Tuesday, Jan. 21, 2020, in New York. (AP PhotoFrank Franklin II)

New York Islanders' Anders Lee (27) celebrates with teammates after scoring a goal during the second period of an NHL hockey game against the New York Rangers Tuesday, Jan. 21, 2020, in New York. (AP PhotoFrank Franklin II)

With the Rangers still on the power play and the goalie pulled for a 6-on-4 advantage, Kreider scored on the rebound of Mika Zibanejad's shot to make it 4-2 with 4:28 to go. It was Kreider's 17th.

After a time out by the Rangers, the Islanders were given a delay of game penalty — putting the Rangers on the power play again with 4:26 left. The Rangers again pulled Georgiev for another 6-on-4, but couldn't take advantage.

The Rangers trailed 2-0 after one period, and Zibanejad nearly cut the deficit in half in the opening minute of the second but his shot went off a goalpost.

New York Rangers goaltender Alexandar Georgiev, right, stops a shot on goal by New York Islanders' Mathew Barzal during the second period of an NHL hockey game Tuesday, Jan. 21, 2020, in New York. (AP PhotoFrank Franklin II)

New York Rangers goaltender Alexandar Georgiev, right, stops a shot on goal by New York Islanders' Mathew Barzal during the second period of an NHL hockey game Tuesday, Jan. 21, 2020, in New York. (AP PhotoFrank Franklin II)

Lee fired a one-timer off a pass from Barzal past Georgiev for his 16th at 9:52 of the second for a 3-0 lead. The puck appeared to deflect in off the Rangers’ Ryan Lindgren, the second time in the game a goal was scored off the defenseman.

Nick Leddy rang a shot off a goalpost for the Islanders with just under nine minutes left in the middle period.

Ryan Strome appeared to get the Rangers on the scoreboard with 2:08 left in the second, but the Islanders challenged for offside on the play and, after a review, the goal was erased.

New York Rangers goaltender Alexandar Georgiev (40) watches a puck shot by New York Islanders' Brock Nelson for a goal during the third period of an NHL hockey game Tuesday, Jan. 21, 2020, in New York. The Islanders won 4-2. (AP PhotoFrank Franklin II)

New York Rangers goaltender Alexandar Georgiev (40) watches a puck shot by New York Islanders' Brock Nelson for a goal during the third period of an NHL hockey game Tuesday, Jan. 21, 2020, in New York. The Islanders won 4-2. (AP PhotoFrank Franklin II)

The Rangers also controlled play for much of the first 12 minutes of the game. Greiss made several nice stops to keep the Rangers off the scoreboard, including a stellar save on a slap shot by Buchnevich with 8:34 left.

On the other end, Barzal fired a shot off the crossbar less than 20 seconds later. The Rangers had an 8-1 advantage on shots on goal at the time.

With the Islanders on a power play, Bailey deflected a shot by rookie defenseman Noah Dobson. Georgiev made the save, but the puck deflected off Lindgren’s leg and in. Bailey was credited with his 11th goal with 6:25 remaining.

New York Islanders goaltender Thomas Greiss (1) defends his net from New York Rangers' Ryan Strome (16) during the first period of an NHL hockey game Tuesday, Jan. 21, 2020, in New York. (AP PhotoFrank Franklin II)

New York Islanders goaltender Thomas Greiss (1) defends his net from New York Rangers' Ryan Strome (16) during the first period of an NHL hockey game Tuesday, Jan. 21, 2020, in New York. (AP PhotoFrank Franklin II)

The Islanders were on another power play as Beauvillier got the puck from Barzal high between the circles, skated forward and fired the puck past Georgiev for his 18th with 3:25 left in the period to make it 2-0.

NOTES: Panarin, signed to a seven-year, $81.5 million deal last summer, missed his first game this season. He has totaled 26 goals and 42 assists in 47 games, including a career high-tying five points (two goals, three assists) in the Rangers’ 6-2 win over the Islanders on Jan. 13. ... Rangers F Jesper Fast played in his 400th career NHL game. ... The Rangers began a stretch of six of their next seven games at home. ... The teams conclude the season series Feb. 25 at Nassau Coliseum. ... Bailey has three goals and three assists in his last seven games. ... Lee scored for the second straight game and has five goals and an assist in his last nine games.

UP NEXT

New York Islanders goaltender Thomas Greiss stops a shot on goal by New York Rangers' Brett Howden, left, during the second period of an NHL hockey game Tuesday, Jan. 21, 2020, in New York. (AP PhotoFrank Franklin II)

New York Islanders goaltender Thomas Greiss stops a shot on goal by New York Rangers' Brett Howden, left, during the second period of an NHL hockey game Tuesday, Jan. 21, 2020, in New York. (AP PhotoFrank Franklin II)

Islanders: Host Vancouver on Feb. 1 to open a three-game homestand in Brooklyn.

Rangers: Host Detroit on Jan. 31 to open a two-night, home-and-home set with the Red Wings.

Follow Vin Cherwoo at https://www.twitter.com/VinCherwooAP

More AP NHL: https://www.apnews.com/NHL and https://www.twitter.com/AP_Sports