A Brooklyn judge has left the door open for tenants who claim that emotional disabilities require an exception to no-pets policies, while closing the door to one particular family.

Justice David I. Schmidt ruled in an Article 78 proceeding that a girl’s terrier is not medically necessary under the law. Thus the managers of a Bensonhurst apartment building may evict the “anxious and depressed” 9-year-old and her mother for having the pet, he ruled.