The Yankees' acquisition of Frankie Montas (left) from the Athletics...

The Yankees' acquisition of Frankie Montas (left) from the Athletics is a reminder of the trade for Sonny Gray (inside) from Oakland a few years back. Credit: Getty Images

On deadline day in 2017, the Yankees made a big-splash move when they acquired one of the top starting pitchers on the market from the Oakland A’s for prospects.

That pitcher was Sonny Gray.

That is the only cautionary note we can offer about the Yankees’ deadline-day-eve acquisition on Monday of Frankie Montas from the Oakland A’s.

Sometimes the best-looking deadline deals don’t work out. Gray was a bust in New York, a deer-in-the-headlights type who just couldn’t make it here. It was a relief to him and the Yankees when he was traded to the Reds after the 2018 season.

In Montas, the Yankees got the consensus second-ranked starter on the trade market behind Luis Castillo, who went from Cincinnati to Seattle and, by coincidence, will start against the Yankees on Wednesday.

Montas comes to the Bronx along with reliever Lou Trivino (who now gets to throw to Jose Trevino) for lefthanders JP Sears and Ken Waldichuk, righty Luis Medina and infielder Cooper Bowman.

Earlier in the day, the Yankees acquired reliever Scott Effross from the Cubs for righthander Hayden Wesneski.

So the rotation has been fortified by the 29-year-old Montas. The bullpen has been restocked after injuries to Chad Green and Michael King.

Throw in Wednesday’s trade for leftfielder Andrew Benintendi and the Yankees — unless they somehow acquire the uber-talented Juan Soto — probably are done before Tuesday’s 6 p.m. trade deadline.

Brian Cashman and his lieutenants probably were popping some champagne (figuratively speaking, of course) after getting Benintendi and completing Monday’s trades.

For the Yankees to get an outfielder who lets them say a final farewell to Joey Gallo (expect that sad saga to officially end on Tuesday) and then three pitchers without giving up any of their top four prospects appears to be a job well-done.

Remember, it’s about trying to win the World Series in the Bronx, especially this year, with Aaron Judge chasing Roger Maris for the clean home run record.

Maybe Waldichuk will turn into an All-Star starter. Perhaps Medina (No. 10) and his golden arm will light up the radar gun in front of minimal fans in Oakland.

Maybe one of the other players the Yankees sent to Kansas City, Oakland and Chicago — none from the top 10 list — will make them rue the day they agreed to these deals.

But don’t bet on it. In exchange for Gray, the A’s got outfielder Dustin Fowler, infielder Jorge Mateo and righthander James Kaprielian. No Yankees fan has shed a single tear over the loss of any of them.

Unless they were saving them to send to Washington for Soto, the Yankees still have their top prospects in shortstops Anthony Volpe and Oswald Peraza, outfielder Jasson Dominguez and catcher Austin Wells.

What do we know about Montas? His best year was last year, when he went 13-9 with a 3.37 ERA and 207 strikeouts in 187 innings for Oakland.

This year, for a dreadful squad, he is 4-9 with a 3.18 ERA with 109 Ks in 104 2⁄3 innings.

Montas has two games of postseason experience, both in 2020. He was the winning pitcher in relief in Oakland’s series-clinching Game 3 victory over the White Sox in the wild-card series. He got rocked by Houston for five runs in 3 2⁄3 innings in his only start in the ALDS.

Ah, Houston. Somehow it seems inevitable that this Yankees season will come down to the ALCS against the Astros. Montas knows them well from pitching against them in the same division since 2017.

In 15 career regular-season appearances (13 starts), Montas is an impressive 8-5, 3.40 against the Astros, including 1-1, 3.00 in two starts this season.

We know most Yankees fans don’t care if Cashman got Frankie Montas or Frankie Avalon. Whoever makes a big impact on the way to World Series title No. 28 is who they want.

Is that Montas? If the answer in October is yes, the champagne will be flowing in the Bronx — for real this time.

If not? Shades of Gray, five years later.