Those shops have been in free-fall as New York has evolved from gritty to ritzy. Rules put in place in 1995 require so-called adult establishments to be 500 feet away from things like schools and religious establishments, by city regulation. The effect was swift: In 1993 there were 177 shops, theaters and bars of the adult variety, according to a study conducted by the City Planning Commission. A subsequent survey found that number had fallen by nearly a quarter by 2001, according to the Department of City Planning. The city does not keep a current tally, but today, there are fewer than 50, according to Erica T. Dubno, a lawyer who has handled legal challenges to the city’s sex shops for decades.

A June decision by the Court of Appeals stands to shrink the number further. In it, the court upheld a 2001 city rule that expanded the criteria for what may be considered “adult” to establishments that offer explicit imagery like videos or peep shows. It broadened which stores may be subject to its stringent regulation.

“Porn has been around forever, and it is going to continue. And it is either going to be aboveground where people are going to pay taxes on it, or it’s going to be underground, where they won’t,” said Judith Lynne Hanna, the author of “Naked Truth: Strip Clubs, Democracy and a Christian Right” and an anthropologist who studies the First Amendment implications of stripping. “And so it should be available just like any shop or any business.”

In Greenwich Village, once an emporium of kink, at least five stores have shut in the past seven years, according to several sex shop employees who work in the handful that remain. While things like real estate values have contributed to the decline, exacerbating it is the fact that the city paints the definition of an adult shop with a very broad brush, according to Ms. Dubno. Images on the packaging of lingerie, for example, have sometimes been interpreted to put a shop within the scope of the 2001 law, she said.