Josh Bailey, Anders Lee, Johnny Boychuk and Casey Cizikas scored for New York (19-13-4), which has won five of its past six games and trailed 3-1 late in the second period. Robin Lehner made 10 saves in relief of Thomas Greiss, who allowed three goals on 17 shots before being pulled at 6:11 of the second period.
"We knew we had to get better; we knew it was getting ugly there a little bit," Barzal said. "I'm just trying to look at the net a little more. I only had two shots, so I'm just trying to make the right play. If the shot's there, the shot's there; if it's not, it's not. I've got two scoring players on my line (Bailey and Anthony Beauvillier), and they can score. I'm going to try to get them the puck; they do the same to me. The chemistry's been good lately."
WATCH: [All Senators vs. Islanders highlights]
Mark Stone, Matt Duchene and Cody Ceci scored for Ottawa (15-19-4), which has lost three in a row. Mike McKenna made 33 saves.
"I thought we were solid, came out strong, had control of the game," Senators coach Guy Boucher said. "We gave them two goals. When you give two goals to the opponent, you give them life and they're home and they got momentum out of it."
The Senators took a 1-0 lead at 16:18 of the first period when Stone scored on a wrist shot after intercepting Adam Pelech's pass in the left face-off circle.
Duchene made it 2-0 with a power-play goal at 2:47 of the second period when he deked Boychuk in the slot and scored on a wrist shot for his 15th of the season.
The Islanders responded when McKenna turned the puck over to Barzal, who quickly fed Bailey for a one-timer to make it 2-1 at 3:11.