Faux heiress Anna Sorokin may have inked a lucrative Netflix deal, but she won’t be raking in the dough anytime soon — thanks to “Son of Sam” David Berkowitz.

The state Attorney General’s Office is invoking New York’s “Son of Sam Law” to try and convince a judge that all of the profits from the hotly anticipated Shonda Rhimes-produced drama about Sorokin’s case go to her victims, The Post has learned.

“The monies sought to be preserved herein, constitute “profits from a crime,’” wrote Assistant Attorney General Adele Durand in recently filed court papers.

Sorokin called herself Anna Delvey and posed as a German heiress worth $67 million to scam banks and hotels out of hundreds of thousands of dollars.

She was convicted in May after a colorful trial, where the judge criticized her for being more concerned about her appearance than the charges against her and sentenced her to four to 12 years in prison.

Sorokin inked the Netflix gig long before her trial got under way in June 2018, while cooling her heels on Rikers Island.

The first payout from the deal, $30,000, went directly to her lawyer, Todd Spodek, to cover a portion of his legal fees, the papers say.

The AG’s office is not challenging that payment. But prosecutors want a judge to block all other disbursements in accordance with the state law, which prevents criminals from profiting off their crimes.

The legislation was named after notorious serial killer Berkowitz, who made national headlines for his shocking New York City murder spree in the late 1970s. It was passed and signed into law just weeks in 1977, the year he was captured.

Sorokin was due an additional $70,000 on June 8 for her Netflix deal — but that payment is now on hold, pending the outcome of the suit, the papers state.

In addition to the sum, the contract states that Netflix will pay her a $7,500 royalty in addition to a $15,000 consulting fee for each episode.

After Sorokin’s conviction, Justice Diane Kiesel signed a restitution order totaling $198,956.19. She owes City National Bank, which she duped into a loan by faking bank statements, $100,000, which she got while trying to negotiate a $22 million loan to launch a private art club in Manhattan.

“As a representative of the crime victim, I have a valid claim against, and intend to sue immediately … this convicted person for damages caused by such crimes,” wrote bank lawyer Peter Hebert in an affidavit for the suit.

A judge is waiting for Sorokin’s lawyers to respond.

TV crews from as far away as Germany and Russia covered her highly publicized Manhattan trial.

Sorokin hired a celebrity stylist to handpick her courtroom attire, which included pieces from Yves Saint Laurent, Victoria Beckman and Miu Miu.

But the handoff of designer clothing to her often didn’t go smoothly on Rikers Island, and Sorokin, dissatisfied with her wardrobe, threw sobbing temper tantrums that delayed the trial.

Her couture caterwauling kept jurors waiting for hours on at least three separate occasions.

The jury did find Sorokin not guilty of promising her ex-pal and former Vanity Fair photo editor Rachel Williams an all-expenses-paid trip to Morocco and then sticking her with a $70,000 bill.

Williams’ sold her story on their friendship and the ill-fated trip to HBO and Simon & Schuster in a deal worth $600,000.

The book is expected to be released this Tuesday, sources said.

Meanwhile, a team of writers is currently hammering out the Netflix show’s script.

Spodek didn’t return a request for comment.