The lawsuit represents an early test of the mayor’s luxury housing levy.