Zibanejad's goal made it 2-1 at 9:34. Panarin deliberately carried the puck into the zone on the right side and delivered a cross-circle pass to Zibanejad for a one-timer from the left side.
But Buffalo regained the two-goal lead on Zucker's power-play goal at 12:34 that made it 3-1.
Quick made the save on Rasmus Dahlin's one-timer from the point, but the puck popped into the slot, hit off Zucker's back and went into the net before the Rangers goalie could locate it again.
The Sabres were 0-for-15 on the power play in their previous seven games.
"I thought we had some good stuff going in the second," Zibanejad said. "To me they get a lucky bounce on their power play. He makes the save, it hits them and goes into our goal and it's 3-1."
Trocheck scored on the Rangers' first shot of the third period at 51 seconds to cut Buffalo's lead to 3-2.
New York pushed from there, but Ellis made nine saves after Trocheck's goal before Samuelsson gave Buffalo a 4-2 lead with a short-handed goal at 14:38, just 14 seconds after Peyton Krebs was called for a double-minor for high sticking Trocheck.
Alexis Lafreniere's turnover led to Samuelsson's rush, and he scored with a shot past Quick's right ear from the bottom of the left circle.
"Definitely trying to go short side," Samuelsson said. "I think everyone knows Quick's style. You grow up watching him. He's more of a down low goalie for sure. Just glad that one didn't go high and wide and wrap around."
Said Doan, "That's an unbelievable shot and probably the best shot I've seen live. Tip your cap to him on that one."
Lafreniere was on the ice in that situation because Trocheck was cut by Krebs' high stick and had to go to the bench. Rangers coach Mike Sullivan said the plan was for Trocheck to come on the ice as soon as the puck was sent low into the offensive zone, but that never happened.
"The players have a game plan going in so they have an understanding of what they're up against," Sullivan said. "At the end of the day it's a player's game and it boils down to decision making and execution."
McLeod scored into the empty net at 18:30 for the 5-2 final.
NOTES: Rangers forward J.T. Miller had an assist and won 10 of 15 face-offs in 20:24 of ice time in his first game since Dec. 20. He missed seven games with an upper-body injury. ... Panarin extended his multipoint streak to four games (nine points; two goals, seven assists) and reached 600 career assists with his second assist. ... Trocheck extended his point streak to five games (six points; three goals, three assists).