Seagram’s heiress Clare Bronfman collapsed in court Wednesday following a discussion with the judge about whether embattled lawyer Michael Avenatti had joined her defense team.

Bronfman was in Brooklyn federal court for a hearing in the Nxivm sex-cult racketeering case when Judge Nicholas Garaufis said he’d been told “that she had an additional attorney who was negotiating with the government.”

“Did she retain Mr. Avenatti to represent her in this case, yes or no?” Garaufis asked Donna Newman, one of Bronfman’s lawyers.

The question came just two days after Avenatti was busted in Manhattan on charges he tried to extort more than $20 million with the help of a co-conspirator, identified by several news outlets as celebrity lawyer Mark Geragos, who Bronfman hired late last month.

Rather than answer, Newman requested a sidebar with the judge, and Bronfman joined more than a half-dozen lawyers for a private, 10-minute discussion next to Garaufis’ bench.

On her way back, Bronfman — whose face appeared yellowish — stumbled and fell forward, but broke her fall by planting her hands on the defense table.

One of her lawyers grabbed her and helped her to a chair, where she drank some water while courtroom personnel summoned an ambulance.

A short time later, EMTs appeared with a stretcher, and Bronfman climbed on and was wheeled into a nearby conference room.

Nxivm leader Keith Raniere was taken to a holding cell, but Bronfman’s other co-defendants — including “Smallville” actress Allison Mack — weren’t present for the hearing.

About 20 minutes later, Bronfman walked back into the courtroom, where Newman told the judge, “Her skin has not come back to color. And they recommend she go to the hospital.”

Geragos also said, “She did black out, probably for 35 seconds to a minute.”

Prosecutor Mark Lesko then told Garaufis that he’d met with Avenatti and Geragos last week to discuss the case, prompting the judge to scold Bronfman’s lawyers.

“There is no privilege associated with retention of counsel … I control and run this case!” he yelled.

Garaufis ordered everyone back to court on Thursday to settle the issue of Avenatti’s involvement.

On his way out of the courtroom, Geragos tried to duck reporters’ questions about whether he’s Avenatti’s alleged co-conspirator, saying that under Department of Justice policy, “that’s not something they disclose.”

Asked if he was cooperating with the feds, Geragos mumbled, “No.”