The lead was two runs, and Rays star Evan Longoria was coming to bat representing the tying run. For a Yankees team on a postseason mission, that’s a critical situation. And so it is no surprise that Joe Girardi opted to deploy the most effective weapon in his deep bullpen.

It didn’t matter that this was only the fifth inning. He brought in Chad Green, one of the team’s most fascinating instruments, to replace starter Jaime Garcia. “This is about winning games now,” Girardi said.

The righthander got Longoria to fly out. Then he struck out the side in order in the sixth as the Yankees went on to a 3-2 win Wednesday at Citi Field. Green was credited with the victory and is 5-0 with a 1.96 ERA.

“This is how he’s used me the past three or four outings — it’s not new to me,” Green said. “I need to get a big out right there.”

Girardi called Green “as good as anyone in our bullpen.” He might be the best arm there right now. In his past seven appearances — the last five entering in the sixth inning or earlier — he has pitched 12 1⁄3 innings to a 0.73 ERA. He has faced 44 batters and allowed just seven hits and no walks while striking out 24 with an array of high-octane fastballs that move late.

“He’s attacking guys with heaters. He’s got a good swing-and-miss pitch with that heater,” catcher Austin Romine said. “Today he was throwing extra hard, so it was getting on guys a little more.”

advertisement | advertise on newsday

In his 15-pitch sixth inning, all three Rays struck out swinging, and only two pitches were fouled off. For the season Green has whiffed 99 of 235 hitters he’s faced.

“A lot of swing-and-misses — I wish I could put my finger on it,” Romine said. “He comes at you with that heater that’s 97-99. He’s behind the ball. He spins it. He can put whatever he wants on it.”

The unlabeled role in which Girardi is utilizing Green is not dissimilar to how the Indians used Andrew Miller to get critical outs early and late in games as they won the 2016 pennant. And with the example set by David Robertson, a former closer who was agreeable to pitching in the fifth inning of Monday’s win, members of the bullpen are comfortable with it.

“Everybody has an open mind,’’ Green said. “We all have the same goal.”

Girardi has the end-game trio of Robertson, Dellin Betances and closer Aroldis Chapman, but acknowledges games can be won or lost before he typically would use them. It’s why Green has become so valuable.

“It’s become more important as starters are going less and less,” Girardi said. “Had we not so much depth in the seventh and eighth inning, you might think about [using him] different. But . . . it’s been a good role for him.”