The Rangers and Tampa Bay Lightning made a bold trade on deadline day, but it was the stand-pat Maple Leafs who gained ground in the standings.

After coming perilously close to blowing a two-goal third-period lead at Madison Square Garden, thanks again to their toxic power play’s penchant for short-handed goals, they ended up spoiling Martin St. Louis’s Broadway debut.

Tyler Bozak’s second of the night came in overtime, after he’d beaten Henrik Lundqvist on a penalty shot, giving Toronto a 3-2 win, its first since the Olympic break. The Leafs passed the Lightning by a point to escape wild-card country for at least one night and moved four up on the Rangers.

“It doesn’t feel so good right now, but tomorrow in the standings it will show two points,” said coach Randy Carlyle.

He paced the bench looking to throttle someone as the Rangers scored twice with Brad Richards in the box to erase the hard-earned Leafs lead.

“(A coach turns) grey, bald, old ... all of the above,” Carlyle said. “But late in the third period, we got the puck deep and played a grind game. Points are at a premium now. We need that before we go out on the road (for five of the next six).”

Toronto looked fine after Nazem Kadri came out of a scoring funk to bury a Nikolai Kulemin rebound early the third and drew the Nash penalty. But then came a Ryan McDonagh double deflection that ramped up off a Leaf stick and banked in off Dion Phaneuf, who was well out of Jonathan Bernier’s line of sight. Not Phaneuf’s fault, but the whole unit had been stuck in its own end. Phaneuf took a hard tumble into the boards later in the third and after finishing the game gingerly, spent much time in the trainer’s room.

With Toronto trying to shake that off , Phil Kessel tried to force a pass through about three Rangers, with Derek Stepan picking it off. He set up ex-Leaf Dominic Moore for a breakaway and in a New York minute, the dead building was on its feet. It was the second time in four games the Leafs had given up short-handed goals on the same minor and dropped them to a league worst 10 against overall.