NEW YORK, N.Y. - The New York Rangers' latest victory was hardly a masterpiece, until the final second.

A quick glance between Carl Hagelin and Derek Stepan produced the winning goal on New York's only shot of overtime. Hagelin deflected in Stepan's slick backhand pass at 2:55 to give the Rangers a 3-2 come-from-behind victory over the Ottawa Senators on Tuesday night.

"The whole game was sluggish from our part," Hagelin said. "Step saw me going in. Two defencemen stepped in on him, and he made the perfect play to me."

The connection gave the Rangers their third straight win heading into the All-Star break, and ended a rough run at home against the Senators. Ottawa had been 13-1-1 in its previous 15 regular-season games at Madison Square Garden since April 2006.

The Senators had the better of the chances in overtime, but Hagelin put the winner behind Craig Anderson as the Rangers won for the 16th time in 19 games.

"They can't all be Picassos," coach Alain Vigneault said following his 494th NHL victory. "This game is about finding ways to win when you're not at your best."

Chris Kreider tied it for New York in the third period. Kevin Hayes also scored, and Henrik Lundqvist made 33 saves.

"I wouldn't want to have a start like that and depend on a late comeback," Rangers captain Ryan McDonagh said. "They took a lead going into the third but ... we weren't going to let this one slip away from us.

"Everyone knew it was going to be an ugly two points, and some team was going to have to find a way."

Erik Karlsson and Milan Michalek scored 1:03 apart in the second period for Ottawa. Anderson stopped 32 shots, but let New York's only one in overtime get by him.

"I saw a pretty good pass and a pretty good deflection," Anderson said. "Hagelin has a good stick. We're not winning too many close games, and it's frustrating. It's not fun to be around that."

The Senators are 4-6-3 in their last 13 and 9-10-9 overall in one-goal games.

"We played a good game. We're just not playing good enough to win close games," Ottawa forward Erik Condra said.

Kreider tied it 2-all at 2:42 of the third when he took a perfect feed from defenceman Marc Staal as he cruised down the slot, deftly shifted the puck to his forehand and lifted in his 10th goal and fifth in 10 games.

"It was definitely a character win," Kreider said. "We probably didn't have the start we wanted, had a few lulls, but it says a lot about the leadership in the room that we were able to gather ourselves and be ready to play."

After falling behind 1-0 on Hayes' goal, the Senators scored twice in quick succession to grab a 2-1 lead.

Right after Condra was stopped by Lundqvist, the Senators regained control of the puck and worked it around the Rangers zone. Kyle Turris sent a crisp pass from the left circle to the right circle, and Karlsson snapped in his ninth goal at 13:38.

Then, just 9 seconds after New York's Lee Stempniak was called for high-sticking, Michalek got to a rebound in front and slid a backhander that slithered its way under Lundqvist's pad for his sixth goal, putting the Senators ahead with 5:19 remaining in the second.

It just wasn't enough to get a much-needed win for the Senators, who are well off the playoff pace.

"This is how our season has gone. Close but not close enough," defenceman Jared Cowen said. "That's what separates good and great teams. We have to decide which we want to be. It's frustrating for sure. With frustration you can either use it or let it eat away at you."

The Rangers had broken the scoreless deadlock at 9:29 when Hayes corralled the rebound of Dan Girardi's hard shot from the right point, calmly shifted left in the slot and scored his sixth goal.

The Rangers finished their second straight period on the power play, this time the remnants of a two-man advantage created when David Legwand and Eric Gryba were whistled for infractions 46 seconds apart.

The teams slogged through a tight-checking first period that produced one power play for each club and a total of 16 shots — nine for the Rangers, including a hard drive by McDonagh that was stopped at the buzzer.

NOTES: Vigneault coached in his 932nd NHL game, tying Rangers general manager — and former coach — Glen Sather for 26th place on the league's career list. He has three fewer wins than Sather. ... Turris has a Senators-high 13 assists and 19 points on the road. ... The Rangers hadn't won 16 of 19 since 1993.