At some point in the days leading up to Dillon Gee’s start last night, Terry Collins chatted with his struggling right-hander. The manager pointed out that in 2011, Gee was a 13-game winner.

“If you’re not hurt,” Collins said, “it’s still in there.”

Gee took the mound last night with an unsightly 6.34 ERA, his rotation future unsecured thanks to his own struggles, Jeremy Hefner’s fine stretch and Zack Wheeler’s imminent arrival. But Gee was spectacular last night, delivering one of the best performances of his career and among the best starts any pitcher has produced against the Yankees this season.

In the Mets’ 3-1 win at Yankee Stadium, Gee fired 7 1/3 innings of one-run ball, allowing just four hits. He walked nobody and struck out a career-high 12, including the final five batters he faced and nine of his final 12.

“It’s hard to put in words,” said Gee (3-6), who had not won a decision since May 1 at Miami. “I needed that on so many levels.”

Collins told The Post on Wednesday that if Gee lost his rotation job, he would not be sent to the minors and instead could be a bullpen candidate. So Gee was not in danger of a Triple-A demotion like teammates Ike Davis and Ruben Tejada. But his rotation spot was a big question, assuming Jonathon Niese’s shoulder tendinitis is not anything major. Collins said he told Gee there was a shot he could lose his job.