Yankees starting pitcher Gerrit Cole reacts during the fifth inning...

Yankees starting pitcher Gerrit Cole reacts during the fifth inning against the Los Angeles Dodgers in Game 5 of the World Series. Credit: Kathleen Malone-Van Dyke

SAN ANTONIO

Fresh off their crushing five-game World Series loss to the Dodgers, the Yankees picked up their first W of this postseason Monday: keeping Gerrit Cole while saving $36 million in the process.

Last week, that didn’t seem possible. When Cole exercised the opt-out in his nine-year, $324 million contract — a clause dutifully inserted by his agent, Scott Boras — there were two ways this thing could go.

Either the Yankees would tack on a 10th year worth another $36 million to automatically trigger his return to the Bronx . . . or Cole would hit the free-agent market.

Personally, I didn’t figure this to be much of a decision for the Yankees, given Cole’s importance to the franchise and their particularly thin rotation options in the short term.

And Cole being a loyal Boras guy, that’s what the opt-out is there for. What good is leverage if you don’t use it? Weighing those two sides, all that was left was for the Yankees to rubber-stamp that 10th year by Monday’s 5 p.m. ET deadline.

But that’s not what happened. Turns out it was the Yankees who had the hammer in this relationship, and they didn’t blink when confronting Cole with the very real possibility that his days in pinstripes — the uniform he dreamed about wearing as a kid —  likely would be finished if he chose free agency over the Bronx.

Brian Cashman didn’t frame the conversation exactly in that fashion upon his arrival here at the general managers' meetings. He talked about telling Cole and Boras how the Yankees felt the window was too rushed and that they needed more time to think about it — the original deadline was moved from midnight Sunday to Monday afternoon — given that the World Series had just ended.

Cashman mentioned the mutual desire to stay together, how badly they wanted their ace back and the fact that Cole really didn't want to leave. The GM described their “amazing relationship” and said Cole is “family.”

Both sides can dress it up any way they choose, but the bottom line was this: Cole blinked first. He already had forced the Yankees’ hand by opting out  and yet he was going nowhere, even without the extra $36 million. Instead, he remains atop the Yankees’ rotation for the four years and $144 million left on his original deal.

Cashman tossed in that the two sides agreed to possible extension talks, but the GM was just being nice at that point. Cole will be 38 by the end of this contract, and there’s no reason to revisit the subject until then.

Game over. And this is a big W for Cashman heading into a huge offseason for the Yankees.

“He’s one of the best starting pitchers in baseball,” Cashman said. “He knows us, we know him. One thing we can certainly count on is New York is not too big for him. And as we’ve all experienced, that’s not always the case with others. His work ethic is second to none, his prep is second to none. So we’re really just comfortable to have him still in play for us.

“And hopefully, now that I’m here at the GM meetings, we can try to build around him and [Aaron] Judge and get as much talent as we can. That’s the job every year.”

In the case of Cole, Cashman deftly checked off the first box on his winter agenda, saving Hal Steinbrenner a nice chunk of change down the road.

Life was going to get a lot more complicated for the Yankees if this Cole situation didn’t get ironed out in their favor. Cole would have joined two other Boras clients at the top of this year’s free-agent class — Corbin Burnes and Blake Snell — with Cashman needing to find another ace, someone to play second base, someone to play first base and more bullpen help. And then, of course, there's the matter of trying to re-sign Juan Soto.

That’s an extensive to-do list for a Yankees team coming off its first World Series appearance since 2009, but Cashman apparently still felt confident enough to push the issue with Cole rather than worry about whether he’d actually walk. Cashman said Steinbrenner and team president Randy Levine also were involved in the down-to-the-wire discussions and that the matter wasn’t settled until roughly an hour before Monday’s deadline, as the GM was getting off the plane in San Antonio.

With Cole reversing his opt-out and essentially forfeiting the language from that part of the contract, both MLB and the Players Association had to sign off on the decision. It certainly was no small matter from that perspective but didn’t require any additional sacrifice on the Yankees’ part, other than honoring the remainder of the contract. They get their ace back again, on their terms, and Cole presumably is satisfied with that, too. If not, the door was there.

“Maybe the grass isn’t always greener,” Cashman said. “And that goes for us, too. I know we’d prefer not to be trying to look at how we’re going to replace our ace. We’d rather augment that to add to our ace.”

Cashman has plenty left to do in moving past last week’s brutal end to the World Series. But the Yankees’ successful maneuvering with Cole is a good start to this offseason. They should be so lucky with the rest of it.