Two top Wall Street dealmakers say they were snookered into a four-year legal battle over $10 million in back pay — only to learn from the New York Post that they were legally entitled to that money years ago.

The bankers, Michael Kramer and Derron Slonecker, say their former employer, Perella Weinberg Partners, and its lawyers at Weil, Gotshal & Manges engaged in “misconduct” by failing to disclose that they had botched their compensation back in 2011, according to a letter filed in New York State Supreme Court.

It’s the latest twist in a case that has also led to finger-pointing between Perella and Weil — with Weil recently asking to bow out of representing Perella after expelling the bank from its cafeteria.

As The Post reported in August, Weil lawyers missed a crucial deadline to defer $10.5 million in compensation for Kramer and Slonecker by five months — meaning that, in the eyes of federal and state tax authorities, the dealmakers should have received the money in one shot in 2012.

Weil lawyers only discovered the error in 2015. But by then, Derron and Slonecker had jumped ship to start their own investment bank, Ducera Partners.

Perella had fired them after discovering the plan to create a rival — and then sued them for poaching.

Kramer and Slonecker turned around and sued Perella for some $60 million in lost compensation — including the $10 million they thought they had deferred in 2011.

Attached to the court filing was a copy of The Post’s August story, which revealed that Weil commissioned a report on the compensation error in 2017. The report tentatively cleared Weil of wrongdoing by citing a legal doctrine that allows parties to depart from the terms of a contract if both were operating under the same misunderstanding.

Eight days after The Post’s story on the compensation snafu, Weil informed Perella that its employees were no longer welcome in the firm’s cafeteria on the 26th floor of the General Motors Building near Central Park, according to a memo obtained by The Post.

Earlier this week, Weil lawyers asked Judge O. Peter Sherwood to withdraw from representing Perella, leaving the case to co-counsel Boies Schiller Flexner.

A representative for Kramer and Slonecker declined to comment. A spokeswoman for Weil didn’t return a request for comment.

A person familiar with Perella’s legal team does not believe the letter affects the merit of their claims, the person said.

“We will respond in due course consistent with the court schedule,” Kara Findlay, a spokeswoman for Perella, told The Post.