Accused madam Anna Gristina says she’s the victim of extortion — by the Manhattan DA’s Office — in papers that offer a tantalizing peek into her alleged black book.

The Post has learned that the alleged “Hockey Mom Madam” has signed a sworn court affidavit, to be publicly filed today, in which she describes how prosecutors with the Manhattan district attorney’s official corruption unit pulled her screaming off the street three months ago and demanded she flip on her high-powered pals — or else rot in jail.

The buddies she went to jail for to protect — five alleged johns and business associates, all described as wealthy and prominent — will not be named in the explosive new filings, according to a source familiar with the defense plans.

But the hints that Gristina provides into these five men’s identities — including references to their high stature in the fields of banking, law, real estate and sports — will surely set tongues wagging.

Gristina lawyer Norm Pattis declined last night to discuss the affidavit and accompanying pretrial motion, which are not expected to be filed until this afternoon.

But Pattis did confirm that the purpose of the filing is to ask Manhattan Supreme Court Justice Juan Merchan to hold a hearing on whether the DA’s office has pursued what the lawyer has called a “vindictive prosecution.”

In two previous court appearances, Pattis has argued that Gristina has been prosecuted because she invoked her right to counsel rather than cooperate.

Officials essentially told Gristina, “If you cooperate, you can go home. If not, sit a while,” Pattis told a panel of Appellate Division judges Thursday during a still-pending bail-reduction bid.

“We believe the state’s conduct in this regard is vindictive, and we will be seeking a dismissal of the indictment,” Pattis said last night.

Gristina, a mother of four from upstate Monroe, is accused of running a multimillion-dollar, high-price escort service out of her 200-acre pig-rescue farm and an East 78th Street “brothel.”

Gristina has been held at Rikers Island since her arrest three months ago, unable to post a $2 million bail bond or pony up the $1 million cash bail.

The Appellate Division can rule on her pending bail-reduction bid at any time.

The sky-high bail was set by Merchan after prosecutors argued that she made $15 million in the past decade and that they have her on a 4-year-old wiretap boasting that her high-powered pals and law-enforcement connections would protect her if she were ever about to be arrested.