New York- During the last two years, X-rated shops have made a quiet but pronounced comeback in New York City, with dozens of new businesses opening in the Sunset Park neighborhood of Brooklyn, Greenwich Village and even near Times Square.

But strict new zoning rules now reaching the final stage of a nearly yearlong legal battle could force most of them to close, bringing highly visible changes to the neighborhoods in which the stores have clustered. "What they've done is made it impossible for these guys to stay in business," said Herald Price Fahringer, the lawyer for a coalition of about 75 video stores and X-rated theaters challenging the restrictions in court. "If this law were to be upheld, 85 percent of all the stores would have to close."

Last week a state appellate court upheld the stricter regulations but issued an interim stay of the ruling until later this month, when the state's highest court, the Court of Appeals, will consider whether to grant a permanent stay and hear a further appeal. If the stay is not granted, the new rules would go into effect immediately, sewing up loopholes to zoning regulations enacted by the city during the mid-1990's.

Under those earlier regulations, stores or clubs that devoted at least 60 percent of their inventory or space to non-X-rated material were not considered "adult entertainment" establishments at all, allowing owners who were attentive to the letter of the law to open up sex shops in residential and commercial neighborhoods where they would otherwise have been banned. Strip clubs simply put more space aside for nonsexual entertainment - one opened a sushi bar - and video stores offered action thrillers and comedies as well as sex DVD's.

The new regulations, said John Feinblatt, the city's criminal justice coordinator, would establish a "common-sense test" for whether a business qualifies as a sex shop. Peep shows, signs excluding minors, and other features would all qualify a business as a sex shop and subject it to the more stringent regulations that govern such establishments, he said.

Under those rules, established in 1995, sex shops are banned from residential and most commercial zones. They are allowed in industrial zones and some commercial ones, including parts of Eighth Avenue, the garment district in Midtown, and the West Side of Manhattan. But there is a catch: No sex shop may sit within 500 feet of another such business, of a zone from which they are prohibited, or of "sensitive receptors" like schools or houses of worship.

Mr. Feinblatt said that should the new regulations go into effect, the city would immediately begin reinspecting sex shops to see if they were in compliance.

The 500-foot requirement could prove particularly nettlesome for a large number of the stores. On the west side of Eighth Avenue, for example, three stores selling sex videos -Hustler Video Xtremes, Nilupul Video, and DVD Blowout - occupy a row of storefronts just around the corner from St. Luke's Lutheran Church on 46th Street.

Farther down Eighth Avenue, on 40th Street, three video stores occupy a single building, No. 300. To the east, in the heart of the garment district, are a number of other sex shops, some of them within a block or so of the Millinery Center Synagogue on the Avenue of the Americas.

It was in part to crack down on such "clustering" - which some community leaders say drives out potential high-end tenants and retards economic development - that the 1995 rules were established.

"The problem we really have is the clustering," said Barbara Randall, executive director of the Fashion Center Business Improvement District, which has experienced one of the largest growths in sex-themed businesses, in part because many of the side streets in the district are zoned industrial.

If the new laws are upheld, she noted, the number of such shops will drop significantly. "Even if we max out on the number of porn places we have in the neighborhood, we'll have far fewer than now, and that would be great," Ms. Randall said.

But it would not be so great for the store owners, some of whom have spent years trying to stay open legally.

"They have expended so much money trying to comply with the city's ever-changing regulations," said Jaymee Kahn, a lawyer who helps represent Ten's World-Class Cabaret, a strip club on 21st Street, between Park Avenue and Broadway. "If they say 60/40 isn't good enough, I think my client would be unable to continue to operate."

Not all the video stores and strip clubs would be in danger. A few were exempted when the 1995 changes were made. And some stores may move to an industrial zone or comply with the new law, though that would render them all but unrecognizable as sex-themed businesses.

Mr. Feinblatt, the criminal justice coordinator, said the blocks would change or the stores would. "That," he said, "translates into a better quality of life for those who live in that neighborhood."

At least some owners appear to be preparing for a new regulatory regime. The building at 300 West 40th Street, which houses three X-rated video stores, used to have a fourth. One of its employees, who declined to give his name, said last week at the store that it had switched to selling exclusively mainstream movies about a month ago.

But a few minutes later, an employee of a store next door - who also refused to give his name but said all four establishments had the same owner - denied that the newly rechristened store had ever sold X-rated material.

"It used to be a candy store," he said.