N.Y. Real Property Actions & Proceedings Law § 635
Action against occupants of apartments
In a case where two or more defendants occupy different apartments in a building the plaintiff is entitled to judgment jointly against all the defendants who are liable to him.