A Williamsburg charity is suing the city for not getting a tax break in what insiders say is mayoral payback for its rabbi’s role in the circumcision controversy.

The city wrongfully revoked a property-tax exemption of a building owned by the United Jewish Organizations, the group claims in a lawsuit filed Friday in Manhattan Supreme Court.

City officials said they were open to revisiting the issue if UJO filed an appeal of the revocation. But insiders said the city’s move was a sign Mayor de Blasio is displeased with the group’s leader, Rabbi David Niederman, who has tussled with City Hall over the regulation of mohels who practice oral circumcision rites.

In the metzitzah b’peh ritual, the mohel sucks blood from the wound left by the cut foreskin. Several newborns have contracted herpes during the bris ritual.

De Blasio cut a deal with Hasidic leaders in 2015 that would allow the ritual to go on without a consent form as long as the community identified mohels spreading the infection. But the city has been unhappy with the level of cooperation.

“City Hall is pissed at Niederman for his circumcision shenanigans,” said one Jewish leader with ties to both City Hall and Niederman. “They’re not going to help him with any issues, such as the building’s property-tax exemption.”

UJO is converting a property at 500 Bedford Ave., which has been tax exempt since 2001, into a condo. The city said the building’s change in mission disqualified it from an exemption.

“The city never questioned UJO’s December application to renew the exemption before rejecting it in January,” the UJO argued in its filing.