A Staten Island judge Tuesday ruled to cancel the first round of notices mailed to thousands of New York City homeowners who may have been subjected to Mayor Zohran Mamdani’s tax on luxury second homes and said the city needs to mail new ones.

Staten Island Judge Wayne Ozzi wrote in his decision that the burden to prove residency was unfairly shifted onto city homeowners as part of the process.

“The refusal to use the tax data that was ‘sufficiently available’ to (the city’s Department of Finance) unfairly shifted the burden to thousands of homeowners to prove their basic residency,” the judge wrote.

“This shifted burden is not hyperbolic, as many property owners, perhaps unsophisticated, may need to consult with legal or accounting professionals merely to prove residency, despite such information being readily available to DOF,” the judge’s ruling goes on to say.

Ozzi wrote that the city will need to mail new notices that utilizes “any and all resources and information available to DOF.”

The pied-à-terre tax would apply to properties assessed at $5 million or more owned by non-primary city residents.

In a statement, former First Deputy Mayor Randy Mastro, who represents a lawsuit from a group of homeowners, said he was “gratified” by the decision.

“It’s a shame that it took a lawsuit to get this administration to do the right thing. In short, City Hall botched this rollout and should have just admitted the errors and fixed its own mistake, instead of wasting time and taxpayer dollars by fighting it in court. But now, thanks to this decision, it will have to do it right by the New Yorkers it has wronged,” he continued.