Brooklyn state Supreme Court Justice ShawnDya Simpson has been using a series of rental apartments for more than a decade to claim she’s a borough resident to stay on the right side of the law — while raising a family in a 14-room colonial in a leafy New Jersey suburb, an investigation by The Post has found.

Judges, like other elected officials in New York, are required to be “a resident of the state.” But records show Simpson, 52, has been using second addresses for the requirement since April 2003, when she registered to vote in Brooklyn for a civil-court run.

Then a Brooklyn prosecutor, she listed her home address as a two-bedroom at 230 Jay St. in Downtown Brooklyn, while she was living in the stately brick home in South Orange, NJ, that she and husband Jacob Walthour Jr. bought for $495,000 in June 1998.

When their Garden State home became an issue in that race, Walthour Jr., a money manager who ran his wife’s campaign, explained it by saying they had to live there to “obtain the best health care for a child born with developmental challenges.”

The couple now has three daughters and a son, ages 11 to 22.

After winning, Simpson continued to maintain appearances in Brooklyn by renting an apartment in a converted Tootsie Roll plant on Park Avenue in Clinton Hill dubbed The Chocolate Factory.

In 2007, she used that address to run for Surrogate’s Court, but had her residency challenged by her Democratic primary opponent, state Supreme Court Justice Diana Johnson.

Simpson won a weeklong trial that ended with Queens Judge Peter O’Donoghue finding “clear and convincing evidence” that she’d lived at the Clinton Hill apartment “has lived at 275 Park Ave…. for the last three years.” The ruling was upheld by the state Court of Appeals.

Simpson lost the election to Johnson, but kept her cover going in Clinton Hill thorough the November 2016 elections, when she won a 14-year term to the state Supreme Court.

Five months later, on March 31, 2017, Simpson and Walthour gave up the Park Avenue apartment, according to building manager Metropolitan Property Services, which manages the building.

A fifth-floor neighbor, Leanne Budreau, 62, said Simpson’s unit appeared vacant every time she peeked into its kitchen from a window in her own apartment.

“It looked like someone was warehousing it,” Budreau said.

“I remember there was a plant they left there, and we watched over four years as it died.”

It was rented again five months later, with current tenant Justin Gologorsky, 39, telling The Post he and his wife signed a lease and moved in Sept. 1, 2017.

Since then, Simpson has had difficulty keeping her story straight about her primary address.

And she may have pushed the ruse too far. Board of Elections records show that on Nov. 6, 2017 — a day before Election Day — Simpson used the Park Avenue address on an absentee ballot, saying she wouldn’t be in New York City to vote in person.

Under state law, knowingly voting when not qualified by residency is a felony punishable by a maximum 1 ¹/₃ to 4 years in prison and a $5,000 fine.

Election records also show that on May 19, Simpson changed her Brooklyn address to an apartment at 200 Schermerhorn St., a 158-unit mix of affordable and market-rate apartments known as “State Renaissance Square” near the northern edge of Boerum Hill in Downtown Brooklyn.

Simpson’s eldest child, daughter Shariah Walthour, shares the three-bedroom with two male roommates, a doorman said.

Shariah, 22, declined to comment when she and a man answered the door Sunday.

On June 21, The Post saw Simpson leave her South Orange home and drive away in a white Audi with New Jersey plates around 8:40 a.m., only to return about 20 minutes later. Her youngest child also left their South Orange home and got on a school bus.

That same day, election records show Simpson changed her address back to 275 Park Ave. from 200 Schermerhorn — even though it was now occupied by Gologorsky and his wife.

A neighbor who’s lived several doors away from the South Orange home for the past 15 years described Simpson’s family as “very lovely” and a familiar presence, saying: “I’m sure if our house were to burn down or something they’d let us stay at their place.”

In 2015, Simpson clocked 43 minutes, 3 seconds in the annual Newstead 5K fund-raising race in South Orange, listing herself online as a village resident, and late last year, she co-chaired the 13th Biennial Emerald and Ivory Debutante Cotillion sponsored by the Essex County (NJ) chapter of The Links, a service organization for African-American women.

But last Tuesday, Simpson filed a criminal complaint alleging that a reporter had stalked her inside 275 Park Ave. and was “showing her picture to the neighbors.”

On the complaint, she listed her “permanent” address as 200 Schermerhorn St.

She told The Post she was sharing the pad with her daughter and paid “the majority of the rent.”

Simpson also claimed her name was on the lease, but wouldn’t provide a copy or say why she changed her address back to 275 Park Ave. with the Board of Elections.

But the company that manages 200 Schermerhorn, IBEC Building Corp., said Simpson doesn’t live there.

Election law defines a residence as “that place where a person maintains a fixed, permanent and principal home and to which he, wherever temporarily located, always intends to return.”

In practice, though, the term “residence” is “a little bit malleable,” with court rulings permitting voters with multiple homes to “choose any of them for voting purposes,” state Board of Elections spokesman John Conklin said.

Simpson, meanwhile, couldn’t explain using the Park Avenue address to vote.

“I lived at 275 Park for years. Sometimes you just forget to put the new address. I don’t know what happened that day, what transpired,” she said. “I would not intentionally violate the law, it’s my job. I love the law.

“Have I made some errors? Probably, I’m not perfect, but I try to do my best,” she added.

Fordham law Prof. Bruce Green, who teaches ethics and professional responsibility, said that “there’s obviously a bad appearance if somebody who’s elected in New York isn’t a New York resident.”

“In general, people are expected to be citizens or residents of the places where they vote or hold office because that reflects a membership in, and commitment to, that jurisdiction’s community and the occurrences there. It’s intuitive,” he said.

Additional reporting by Jennifer Bain, Khristina Narizhnaya, Elizabeth Rosner, Alex Taylor and Tina Moore