Brooklyn DA candidate Anne Swern wants to prosecute criminals — when she’s not making a buck as a plaintiff.

Swern, a former high-ranking assistant district attorney under Charles Hynes, last year demanded $5 million from the city in a slip-and-fall case.

And years earlier she sued her own friend for $500,000 for the loss of her husband’s “services” when he hurt his back after a rough boat ride in the Hamptons.

“I would give her nothing. Zero,” said Gerald Shapiro, the boat owner sued by Swern and her husband in 1998.

Shapiro added, “I hope she loses” the DA’s race.

Swern and current acting DA Eric Gonzalez are among six candidates vying to replace the late Ken Thompson as the top law enforcer in Brooklyn.

Swern, 61, worked in the Brooklyn DA’s Office for 33 years, and rose to the position of first assistant district attorney under Hynes. She retired in 2014.

A year later, Swern — then working as a $100-an-hour consultant for the non-profit Brooklyn Defender Services — claims she was on her way back to her office from a lunchtime yoga class when she tripped on a “depression” in a downtown Brooklyn sidewalk.

She says she broke her hand on a metal railing and had surgery on it.

Swern filed a notice of claim with the city in January 2016 and said during a May 2016 hearing that the lingering effects from the tumble made it “much, much more difficult” to do certain tasks. For example, “tweezing my eyebrows, putting on mascara,” and doing “household things.”

City Comptroller Scott Stringer’s office rejected her $5 million claim and she went on to file a lawsuit for unspecified damages.

The city Law Department is trying to have the case transferred to Queens, saying Swern has political power and “participates in the selection and election of judges” in Kings County.

Swern told The Post she was unaware of the city’s July 5 motion to move the case. She said her hand still hurts “in the rain and it’s still tight.”

Swern and her husband’s earlier lawsuit resulted in a $400,000 settlement, Shapiro told The Post.

Shapiro said his boat was going about 10 mph when it hit a wake and her husband, Steven Brounstein, was thrown from his seat and hurt his back.

Brounstein sued for $10 million, claiming ­Shapiro was “negligent.”