White-shoe law firm Weil Gotshal & Manges is bowing out of a long-running Wall Street employment lawsuit amid revelations of botched legal work, The Post has learned.

Lawyers for Weil Gotshal have asked a New York Supreme Court judge to be removed as the lawyers for investment bank Perella Weinberg Partners in a four-year-old suit against two former bankers, according to court filings late Monday.

Weil told Perella “of the need to withdraw on August 29, 2019 and at least twice since then,” Nicholas J. Pappas, a Weil lawyer representing Perella, wrote in the Sept. 16 filing.

Judge O. Peter Sherwood is scheduled to approve the request on Oct. 4, according to the filing. Lawyers for Boies Schiller Flexner, the co-counsel, are expected to take over the litigation, the filing said.

It’s the latest escalation in what has become a strained relationship between Weil and Perella since The Post reported last month that the law firm botched two former Perella bankers’ pay packages — and then left them in the dark about the error for years.

The bungled pay packages stand to complicate Perella’s lawsuit against the same two former bankers — Michael Kramer and Derron Slonecker — who left Perella in 2011 to start their own rival firm. Weil has been representing Perella in the case since 2015.

As The Post reported in August, lawyers for Weil screwed up $10 million in deferred compensation packages for the dealmakers before they jumped ship — and only seemed to acknowledge the issue after it came up at a 2017 deposition in Perella’s employment case against the men.

The law firm’s top legal eagles knew about the screw-up as early as 2015, when they fretted over the implications of not disclosing it to Perella, according to contemporaneous notes from meetings obtained by The Post.

After The Post’s story emerged, Peter Weinberg, one of the investment bank’s founders, and partner Robert Steel told Weil that it could be fired, according to a person briefed on the conversation.

On Aug. 30 — the day after Weil gave notice of their need to withdraw as their counsel — the law firm informed Perella that it was no longer welcome to use its corporate cafeteria, The Post reported last week.

Perella Weinberg, an investment bank that’s advised companies like AT&T and swanky luxury dealer Barney’s, had started in the offices of Weil Gotshal more than 13 years ago, and was one of the law firm’s top clients, according to a person familiar with the relationship.

A spokeswoman for Perella declined to comment on the Kramer matter, and declined to comment on whether Weil is still representing Perella in other matters.

A spokeswoman for Weil didn’t return a request for comment.