Anders Lee, Scott Mayfield, Matt Martin and Casey Cizikas scored for the Islanders, who blocked 23 shots and killed four penalties to remain perfect this season (8-for-8).
"It was a fun game to play," said Lehner, who signed a one-year contract with the Islanders July 3. "It was a great atmosphere today in the building too against a good team. I felt real good."
WATCH: [All Sharks vs. Islanders highlights]
Martin Jones made 26 saves for the Sharks, who outshot the Islanders 16-5 in the third period. San Jose is 0-for-10 on the power play this season.
"They played desperate," Sharks coach Peter DeBoer said. "They blocked a lot of shots. They were heavy, they were hard. They played a good hockey game. That's a one-goal game basically going into the third period on the road, so you've got to give them some credit. They played hard defensively. They didn't give you a whole lot. They found a way to get the first power-play goal and we didn't.
"You've got to give their goalie some credit. He made some big saves at the right time."
Lee gave the Islanders a 1-0 lead with a power-play goal at 14:34 of the second period. With Evander Kane in the box for slashing, Josh Bailey one-timed Mathew Barzal's pass from the right face-off circle that Jones saved with his pad. Lee, who was named Islanders captain Oct. 4, was in front for the rebound and quickly roofed it over Jones for his second goal of the season.