When El Chapo appears in Brooklyn federal court on Tuesday for the first day of a bombshell trial, he’ll have a legal dream team to defend him — at a cost of at least $5 million.

The notorious Mexican cartel king, Joaquin Guzman Loera, 61, who faces life in prison for allegedly running a drug empire worth billions, will have top Manhattan lawyer Jeffery Lichtman on his side, along with two criminal defense attorneys who repped El Chapo’s rival.

Lichtman, 53, famously defended John “Junior” Gotti, son of the late Gambino family godfather John Gotti, on charges he ordered the failed hit on radio host Curtis Sliwa in 1992. Each of Junior’s three trials ended with deadlocked juries.

He’ll be joined by Eduardo Balarezo and William Purpura, who jointly defended Guzman’s nemesis, Alfredo Beltran Leyva, a kingpin known as “The Desert Ant,” on drug trafficking charges. Leyva got convicted last year and was ordered to hand over $529 million to the U.S.

Leyva was fond of wearing grenades strapped to his chest and was once a partner with El Chapo in the Sinaloa Cartel, but he was arrested by the Mexican military in January 2008. He blamed Guzman for ratting him out to the authorities and retaliated against him by ordering the murder of one of Guzman’s sons, Edgar.

El Chapo told the judge in his case that he wanted his family in Mexico to foot his massive legal bills, and there’s plenty of cash from cocaine and marijuana sales to do just that, a federal law-enforcement source told The Post.

Guzman’s wife, sons and extended family live off hundreds of millions of dollars in revenue from drug proceeds, and the Mexican government has declined to seize Guzman’s vast holdings, said the source.

“It’s all drug money,” he told The Post. “The family has no other income, no ranches, no factories, no dairy cattle. They have no other income other than what the father has made through drug trafficking.”

Guzman’s family had previously balked at having to pay for his defense, which they considered a losing proposition, according to a report in Mexico’s El Universal newspaper, but changed their mind after Guzman’s plea to them in court.

One of Team El Chapo’s tasks was to ask a judge to allow him to get a hug from his wife, whom he has not seen in two years.

“It can be a brief embrace in open court,” wrote lawyer Mariel Colon Miro in a two-page letter.

Judge Brian Cogan denied the request on Thursday.

On Friday, the defense got bad news: Top El Chapo lieutenant, Vicente Zambada, pleaded guilty to trafficking conspiracy in Chicago and will cooperate with prosecutors.

Lichtman refused to comment on his fees in the Guzman case, although he has spoken in the past about the enormity of the defense team’s job.

“You saw how many prosecutors were at that table,” said Lichtman in August 2017. “That was enough for a minyan. It’s going to require a similar response from the defense.”

Lawyer Purpura, 66, is based in Baltimore and has a long record of defending drug kingpins. Earlier this month, he told The Baltimore Sun that prosecutors in Guzman’s case have issued more than 300,000 pages of documents in evidence that go back three decades.

There are hundreds of court records and 140,000 wire intercepts, he said. Purpura estimated that defense costs for what could become a four-month trial might reach $5 million.

“In a perfect world that’s how much it would cost,” Purpura told The Post, hinting it could go higher. “But this is not a perfect world.”

Purpura refused to discuss any other issues surrounding his fees and payment from Guzman’s family.

Attorney Balarezo, a 52-year-old Washington-based lawyer, has been advising Guzman since September 2017, nine months after his extradition to the US.

The Ecuadorian-born attorney has taken on several high-profile cases, including Zhenli Ye Gon, a Chinese-Mexican businessman who is suspected of being part of the Sinaloa cartel.

He was extradited to Mexico two years ago on suspicion that he imported chemicals to manufacture methamphetamine. In 2007, police in Mexico confiscated more than $205 million in cash from his palatial home in Mexico City along with a cache of automatic weapons.

As part of its case against Guzman, prosecutors have said they will try to seize an estimated $14 billion in profits from his sale of drugs.