One of the most shameful miscarriages of justice in New York state is powerfully and heartbreakingly dramatized in Ava DuVernay’s “When They See Us,” a four-part series that drops Friday on Netflix.

No matter how well you think you remember the trial of the Central Park Five, the Harlem boys who were sent to jail for the brutal rape of Trisha Meili, aka the Central Park jogger, this harrowing series will anger you, depress you and make you stop buying the crime novels written by Linda Fairstein, the then-head of the Manhattan sex crimes unit who engineered the Thomas Cromwell-like plot against innocent black children.

The discovery of the nearly lifeless body of a white female jogger in the northern section of Central Park on the same night — April 18, 1989 — that a group of teenagers from Harlem went running down the East Drive, harassing bicyclists and creating a sense of mayhem, drove Fairstein ( Felicity Huffman ) to connect the two events. She mobilized the police to drive into the park and round up whomever they could.

“They’re not witnesses, they’re suspects,” she says, before any evidence has been collected or a single question has been asked. She is already constructing a narrative in her troubled mind. During the rounding up, one of the boys, 14-year old Kevin Richardson (Asante Blackk), is punched in the head by a cop. When Fairstein sets eyes on him in the police station, she asks, “What happened to that one?”

So iron-clad is the narrative Fairstein has constructed in her head that at no time does she allow any of these minors a shred of humanity, even when confronted by Sharonne Salaam (the wonderful Aunjanue Ellis, from “If Beale Street Could Talk”), the mother of one of the suspects, Yusef Salaam (Ethan Herisse), who swoops into the 24th Precinct to collect her son after the cops have coerced a dictated and taped confession from him.

DuVernay meticulously and mercilessly shows how NYPD detectives played one boy against the other, promising them they could go home to their parents — they were mostly questioned without an adult relative present, never mind a lawyer — if they ratted each other out.

“You go into those projects and you stop every little slug you see,” commands Fairstein. And that’s how cops found Yusef Salaam and Korey Wise (Jharell Jerome, one of the brightest spots of Barry Jenkins’ “Moonlight”), with Wise volunteering to accompany Salaam to the precinct even though his name wasn’t on any official list. Because he was 16 and considered an adult, he ended up doing time at Rikers.

The mind reels backward when you think this happened in New York City in the 1980s, not Mississippi in the 1960s. DuVernay offers a lacerating portrait of the chasm that exists between the city’s white cops and lawyers and minorities. Real-life footage of Donald Trump, then a press-friendly billionaire, talking about a full-page newspaper ad asking to bring back the death penalty gives “When They See Us” a nightmarish edge that is impossible to shake, especially when you consider the power he wields these days.

While Episode 1 focuses on the night of the arrest of the boys, Episode 2 gives us a ringside seat at the courtroom six months later, when Elizabeth Lederer (Vera Farmiga, in a poodle wig), hand-picked by Fairstein, presents her shoddy case against the children.

The boys have individual lawyers with experience levels that range from amateur to professional, but even these men, played by Joshua Jackson, Blair Underwood and Christopher Jackson, do a more convincing job of detailing the state’s deficits (lack of physical evidence and weapon among them).

Farmiga shines in her scenes with Huffman (whose casting as Fairstein drips with a kind of sick irony, as the actress now faces prison time for her role in the college admissions bribery scandal), punching holes in Fairstein’s strategy and even telling her she is “delusional.” Yet, rather than recuse herself from the case, Lederer presses on, shamelessly pandering to the jury when it is revealed that DNA found on a sock at the crime scene does not match that of the boys.

“Just because there is DNA evidence that someone else was present at the crime scene doesn’t mean that these defendants are innocent,” she seethes. “They can still be guilty of rape under the law. If they did nothing to stop her agony, then they are guilty.”

The facts of the case make the story presented on film more painful to watch. Parts 3 and 4 of “When They See Us” focus on the four minors who went through juvenile detention and Korey Wise’s horrific experience at Rikers. The defendants spent between six and 13 years in jail.

In 2002, incarcerated serial killer Matias Reyes confessed to the rape and the convictions of Antron McRay (Caleel Harris), Richardson, Salaam, Raymond Santana (Marquis Rodriguez) and Wise were vacated. In 2014, the quintet won a $41 million settlement from New York City for malicious prosecution, racial discrimination and emotional distress. Fairstein went on to write mystery novels that racked up $2.5 million in sales by 1999.

The actors are all top-notch — but expect special recognition come Emmy time for Jerome, who dominates the fourth hour, Farmiga and Ellis. “When They See Us” is a tough watch, but viewers will be moved and sickened at the prevalence of racism even in our so-called sophisticated cities.