The city’s Orthodox Jewish community has long been considered a politically salient voting bloc and has been courted by both Mr. Adams and Mr. Yang, who has been endorsed by several ultra-Orthodox leaders.
The endorsements came after Mr. Yang defended the yeshiva education system, which has faced criticism over the failure of some schools to provide a basic secular education: A 2019 city report found that roughly two dozen Hasidic yeshivas had fallen short of city standards in math, science and English education.
In a race where voter interest has so far been low, the endorsement of influential religious leaders could be a boon to any campaign. But even in neighborhoods with large ultra-Orthodox populations, like Borough Park, Brooklyn, there were mixed feelings about Mr. Yang’s initial statement and subsequent turnaround.
“If you’re talking about the Jewish community, if someone is pro-Israel, that will always be seen as a plus,” said Yoel Greenfeld, 22, as he left a synagogue on Borough Park’s main shopping street at midday. “But then for Yang to say something else a day later because of A.O.C.? Let me tell you something, people around here think A.O.C. is a complete joke.”
The Astoria Welfare Society rescinded its invitation to Mr. Yang because his tweet felt like an insult to Muslims in New York City, the group’s secretary general, Mohamed Jabed Uddin, said.
“It is like he is blatantly saying to Muslim New Yorkers that he does not care about us, our issues, the attacks on our houses or worship,” said Mr. Uddin. “He will only take a principled stand when it will pay off politically. That is not the type of leadership that we want for this city.”
Assemblyman Ron Kim of Queens, a progressive who has endorsed Mr. Yang for mayor, said that he thought Mr. Yang’s initial statement was “inhumane,” and he said he had called Mr. Yang on Tuesday to relay his concerns.
“He came off as taking a one-sided, 100 percent pro-Israel dominating position, with no nuance, and I know that that’s not what he believes and I know that those aren’t the values that guide him, especially when there are innocent people dying,” he said.
Jeffery C. Mays and Michael Gold contributed reporting.