A lawsuit represents an early test of the mayor’s controversial housing levy.