NEW YORK — The judge overseeing the criminal case against the Trump Organization and its longtime finance chief was sued Wednesday by a woman whose sensational prosecution in an unrelated case played out in his courtroom nearly a decade ago.

Anna Gristina — whose tabloid moniker “Soccer Mom Madam” fueled news headlines for months — alleged in a lawsuit in federal court that New York Supreme Court Judge Juan Merchan is improperly keeping transcripts from her case sealed and unavailable to her, hindering her quest to vacate her 2012 guilty plea.

Gristina says “her guilty plea was coerced” and is planning to argue for its reversal, the lawsuit states. Her new attorney, Lawrence LaBrew, “needs to determine what was said on the record, and what was not said on the record” before moving forward, says the civil complaint filed in U.S. District Court in Manhattan on Thursday afternoon.

LaBrew is seeking “a declaratory judgment stating that [Gristina] is entitled to the unsealed court minutes” so she can make a “meaningful motion” to overturn her guilty plea.

While lawsuits filed by disgruntled criminal defendants are not uncommon, Gristina’s claim — that she cannot access her own trial record to aid her appeal — could invite further examination of established transparency laws and practices.

But her ultimate goal of seeing her plea undone may prove difficult. Motions to undo a voluntary guilty plea are rare, and defendants are often required to waive their appellate rights when they enter into a plea deal.

Gristina, a Scottish-born suburban mother of four who lives upstate, pleaded guilty in September 2012 to a felony count of promoting prostitution in exchange for a sentence of six months in jail, which amounted to time she had already served. She was also sentenced to a five-year probation period.

Manhattan prosecutors said her client list included New York’s very wealthy and connected. None of her alleged clients were named publicly or charged, however, and Gristina did not cooperate with investigators from the district attorney’s office.

Gristina’s dramatic story of living a secret, high-stakes life while living with her family in a wooded area more than an hour from c was the basis for “Soccer Mom Madam,” a recent Lifetime network production that portrayed her as the head of a high-end prostitution business based in New York.

Earlier this year, a lawyer for Gristina went in front of Merchan to ask for the records. He ruled in May that Gristina “failed to meet her burden to demonstrate why the sealed minutes” from two dates in mid-August 2012 should be made public.

A state appellate court has upheld Merchan’s ruling. LaBrew said he plans to appeal the loss to the state’s highest court. He is also seeking relief in Wednesday’s lawsuit by asking a federal judge to order Merchan to reverse his decision and unseal the items.

“This is part of a pattern of ongoing litigation where the plaintiff did not prevail in state court so an attempt is being made in federal court,” said Lucian Chalfen, a spokesman for the New York State court system.

Gristina has also named Manhattan District Attorney Cyrus R. Vance Jr. as a defendant on the basis that his office argued against releasing the records. A spokesman for Vance did not immediately have a comment.

Merchan, who was first appointed to the bench in 2006 as a family court judge, is handling the criminal case against former president Donald Trump’s namesake company and its chief financial officer, Allen Weisselberg. He has asked attorneys in that case to be prepared for a trial late next summer.

Vance’s office is prosecuting that case. But he is not seeking reelection and will step down as district attorney at the end of this year.