Igor Shesterkin made 23 saves for the Rangers (26-19-6), who had won three in a row.
The Rangers, fifth in the East, are six points behind the Bruins, who have played two fewer games. Two of the four Stanley Cup Playoff beths from the division remain after the Washington Capitals and Pittsburgh Penguins qualified Thursday.
"It's not what we envisioned, it's not what we expected," Rangers coach David Quinn said. "It's just something that we're going to have to learn from. Obviously, a game of this magnitude, we've got to learn how to win games like this."
The Rangers and Islanders play for the final time in the regular season at Nassau Coliseum on Saturday. The Islanders have won five of seven against the Rangers.
"Any loss at this point in the season is going to be demoralizing, but we've still got some games left and we're just going to keep playing," Rangers defenseman Adam Fox said. "How things shake out, it's obviously a tough situation we've put ourselves in, but we're going to just keep playing hard and try to get wins."
It was Varlamov's third shutout against the Rangers this season, each at Madison Square Garden. He made 24 saves in a 4-0 win here on Jan. 14, and 30 saves in a 2-0 victory on Feb. 8.
Varlamov is the first goalie in the NHL expansion era (since 1967-68) to have six shutouts in a season of 56 games or fewer, and the first goalie to shut out the Rangers three times at home in the same season.
"I like to play at Madison Square Garden," Varlamov said. "Every time I play here, it's very special for me. There's a lot of history in this arena."
Komarov, a healthy scratch the previous two games, scored with a far-side one-timer from the right circle at 6:27 of the first period to give the Islanders a 1-0 lead. It was his first regular-season goal since Feb. 21, 2020.
"I'm just trying to play hard and play as good as I can," Komarov said. "Maybe it doesn't look good, maybe it looks good. I don't really care as long as the team wins. I'm happy for that."
The Islanders were outshooting the Rangers 6-0 when Komarov scored.
"I know it was early and it's only 1-0, but I just didn't love the feel after that," Quinn said. "Then they made it 2-0. They just did everything they needed to do. They stayed on top of us, they took away time and space [and] made it difficult for us to get inside. Just made for a long night."