Ironically, the Yankees’ victory song has become the story of a heartbreaking playoff loss.

Former longtime Yankee Mark Teixeira threw heavy criticism on Aaron Judge’s decision to do some light Red Sox trolling before the ALDS was sealed, saying the star outfielder made “a huge mistake” in blasting “New York, New York” at Fenway Park after the Yankees’ Game 2 victory.

That turned out to be the only Yankees series triumph, as Boston eliminated them in Tuesday’s Game 4, and what had been a smirk of a troll job by Judge apparently became a Red Sox rallying point.

“You woke a sleeping giant,” Teixeira said Wednesday morning on ESPN’s “Get Up!” “Aaron Judge has no rings. And I have a ton of respect for Aaron Judge, I think he will have rings. But when you boast — when you wake a sleeping giant in Boston — on your way out back to Yankee Stadium and then get your butts kicked two games in a row, I just think that you might want to let your bat do the talking. Because Aaron Judge’s bat will talk.”

In the post-Game 4 clubhouse in Yankee Stadium, Boston celebrated by cuing Frank Sinatra, with several players joining in the chorus.

“You have players that have their play do the talking,” said Teixeira, whose career overlapped with Judge’s in 2016. “And then you have players that talk. Aaron Judge has done every single thing right his entire career. This — in the middle of a playoff series — why now? Why is now the time for you to do something like this?”

Prior to Boston’s celebration, the Red Sox had not made Judge’s celebration an issue publicly. But as the clubhouse proved, they definitely noticed Judge’s song choice.

“I don’t know if they took it personal, but it’s just, I don’t know, we played ‘Dirty Water’ at Yankee Stadium, and [if] they would have clinched in Fenway, they would have played ‘Dirty Water’ in their clubhouse,” manager Alex Cora said.