Stores following the letter of New York City's new anti-sex shop zoning ordinance must be allowed to stay open, despite the city's questions about their sincerity, the state Court of Appeals said today.

While the Giuliani administration has frequently used the word "sham" to describe the shops' attempts to comply with the law, city officials cannot use overly broad definitions of the statute to move against the sex businesses, the state court said in a 7 to 0 ruling.

The decision was hailed by gay groups and others who have fought the ordinances, which are designed to zone sex shops out of midtown Manhattan and residential neighborhoods.

Les Hommes, a gay bookstore on Manhattan's West Side, challenged a move by city officials to close it down because it did not comply with the zoning law. Shops are considered "adult establishments" subject to zoning prohibitions if at least 40 percent of their floor space displays sexually explicit items or activities.

Les Hommes said at least 60 percent of its floor space was used for non-explicit wares.

The court said the city read too much into the word "stock" in the zoning ordinance. City officials argued that Les Hommes and other sexually oriented businesses had merely added many items to their shelves that weren't "stock" because the stores had no desire or expectation to rent or sell the merchandise.

Daniel Connolly, of the city's corporation counsel, said the ruling "exalts form over substance," but said the city does not plan to appeal.