"This one felt good," said Lehner, who played the previous three seasons with the Sabres before signing with the Islanders as an unrestricted free agent on July 3, 2018. "It was a little weird; it was probably the hardest game I've played in my career."
Leo Komarov, Brock Nelson and Ryan Pulock scored for New York (21-13-4), which has won seven of its past eight games. Islanders coach Barry Trotz got his 783rd career victory, passing Al Arbour for fourth in NHL history.
WATCH: [All Islanders vs. Sabres highlights]
"It was cool," Trotz said. "The guys were really good about it and obviously they know what a milestone [it is] and especially with the Islanders … but more importantly, we got a big win."
Kyle Okposo scored and Carter Hutton made 30 saves for Buffalo (21-13-6), which has lost three in a row and played the final two periods without forward Jack Eichel because of an upper-body injury.
The Sabres have scored two goals or fewer in five of their past six games.
"That's just where we're at right now," Buffalo coach Phil Housley said. "This is testing us. Mentally, we're going to have fight through this, and when I say that, I really like our game, especially the last two games.
"We've got to continue to grind it out and stay the course and not break."
Komarov gave the Islanders a 1-0 lead when Nick Leddy's shot from the point went in off him at 2:59 of the second period.