GREENBURGH, N.Y. — Nearing the halfway point of the NHL season, there’s a line being drawn in the sand for the Rangers.

With the 40th game of the season Tuesday against the Dallas Stars, the Blueshirts are 21-14-4, but just 5-11-2 in the last 18 games.

“Our best hockey has got to come here,” coach Alain Vig neault said, “because all you have to do is look at the standings to know it’s going to be very spirited and competitive every night.”

In other words, as Yogi Berra once said, “it’s getting late early.”

For the past two seasons, Vigneault has relied on a speedy team backed with excellent goaltending, primarily from Henrik Lundqvist, but also Cam Talbot, to keep them from downturns when the offense falters and the defense cracks.

“We need Hank to re-become the Hank that he’s used to, for us, and from there, I think everything else should fall into place,” Vigneault said. “No doubt we have a few players playing subpar.”

After practice Monday, Rangers captain Ryan McDonagh acknowledged that the time for a push is now.

“We’re still kind of middling up and down and it’s going to get us nowhere fast unless we find some consistency, find that motivation to work as hard as you can on the ice to win one hockey game,” he said. “There’s teams all around us who are improving, it’s getting to that time of year where the penalty kill and power plays are getting better. We have to continue to elevate our game.”

Vigneault conceded that when the Rangers were 14-2-2, it “was a huge plus, results-wise, but I don’t think we were playing as well as this group can.” In the last few games, he said: “I have seen some signs of us steering in the right direction. Our chance-against totals are down, we’re playing more physical, we’re generating more pucks and attention toward the other team’s net, our power play has been a good weapon. We’ve got to put it together.”

A stretch of points would help the psyche and the standings.

“It’s not the same confidence we had after 10 games into the season when everything was going our way,” Lundqvist said. “To get to that good place again, we have to work extremely hard and earn the good bounces.”

Notes & quotes: Former Penguin Jayson Megna (7-11-18 in 34 games in Hartford) was recalled and presumably will step in for Chris Kreider (cut hand), whom Vigneault said was doubtful for Tuesday. Emerson Etem skated in Kreider’s spot Monday, but Etem’s play led to two Panthers goals in the 3-0 loss, a poor centering pass late in the first period and a penalty, during which Florida scored on a power play . . . Kevin Hayes, a healthy scratch for two games, is likely to return on the third line.