“I don’t want to be someone who is giving in to these right-wing groups,” Mr. Johnson told Mr. Mays. “But the Supreme Court has become conservative; the Second Circuit, which oversees New York, has become more conservative.”

What to know about conversion therapy

The practice has been widely condemned. The American Psychological Association has said that it doesn’t work and that those who undergo it experience harm.

In January, the New York Legislature voted to bar mental health professionals from working to change a minor’s sexual orientation or gender identity. The state law would govern the city in the absence of a city-specific ban.

Seventeen other states, Washington, D.C., and over 50 municipalities also prohibit the practice for minors, according to the National Center for Lesbian Rights.

Still, the Williams Institute at the U.C.L.A. School of Law estimates that almost 700,000 L.G.B.T.Q. adults ages 18 to 59 have received the therapy — 359,000 of them as adolescents.

The reaction

State Senator Brad Hoylman of Manhattan, the state’s only openly gay senator, said, “I’m heartened that the City Council pulled back a statute that could undermine efforts nationally.”

The Alliance Defending Freedom saw the retreat as admittance of an overstep.

“We went in with confidence that the courts would agree with us,” said Roger Brooks, a lawyer for the group. “This move by the city suggests that on mature consideration, they think that would be the outcome as well.”