TAMPA, Fla. — It was a no-brainer for NBCSN’s “Wednesday Night Rivalry” series, last season’s two Eastern Conference finalists, still loaded with talent and full of recent inter-franchise history, and both now with plenty to prove.

The Rangers entered the game on a 4-10-2 slide after a 16-3-2 start, including 0-6-2 on the road since a victory at Florida Nov. 21. The Lightning have been more consistent this season — consistently mediocre, that is.

One of them had to win last night at Amalie Arena, and it was the Rangers who did, 5-2, a huge relief with which to close out the calendar year.

Tampa Bay had beaten the Rangers in five consecutive regular-season games dating to Dec. 29, 2013 — two years and a day earlier — and also won that conference final over the Blueshirts last May, in seven games.

The score was tied at 2 entering the third period, then the Lightning very nearly took the lead, but Marc Staal swept away a puck just before it crossed the goal line.

Shortly thereafter, Dominic Moore converted off a turnover by Victor Hedman, making a series of nifty moves to beat Lightning goaltender Ben Bishop with 16:44 remaining for what would prove to be the winning goal.

Viktor Stalberg clinched it into an empty net with 1:21 leftfollowed by another empty-netter by Rick Nash.

The Rangers scored first, a mere 1:53 into the game. Keith Yandle showed good patience eschewing a shot and instead threading the puck to Dan Boyle, who scored from the faceoff circle to Bishop’s left.

Moore, who lately has played better than any Harvard alum in New York sports this side of Ryan Fitzpatrick, got the scoring play started by cleanly winning a faceoff.

Moore’s line, the Rangers’ fourth, was the only one left intact by coach Alain Vigneault relative to the ones he used in a 5-3 loss to the Predators Monday.

Later in the first Nash found himself in the box for high-sticking — the Rangers’ third penalty of the period — when Tampa Bay tied it.

Jonathan Marchessault tipped in a slapshot from the blue line by former Ranger Anton Stralman with 3:25 left before the first intermission.

Once again in the second period the Rangers scored early, this time 56 seconds in.

J.T. Miller, newly assigned to the top line alongside Mats Zuccarello and Derick Brassard, threaded his way through most of the Lightning before dropping off the puck for Zuccarello, who beat Bishop high to the glove side.

With 1:23 left in the second, Tanner Glass checked the Lightning’s 6-7, 243-pound Brian Boyle clear over the boards and onto the Rangers bench and was called for interference, even though it appeared Boyle had the puck near him.

On the ensuing power play Stralman’s close-in shot trickled past Lundqvist and over the goal line to make it 2-2 with 8.2 seconds left. The goal initially was waved off because the whistle was blown, then allowed, then confirmed on replay.

The Rangers were set to leave for the state’s east coast after the game, where Saturday night they will conclude their three-game road trip against the Panthers.

First, though, there would be an off day and night. In South Florida. On New Year’s Eve. Does Vigneault believe he needs to warn his team to behave?

“We’ve got a pretty good, mature group,” he said before the game. “I mean, they’re like any other person in society. It’s New Year’s. You celebrate a little. I don’t see anything wrong with that.

“As matter of fact I like the fact that if they do go out I’m pretty sure they’re all going to go out together.”