New York Real Property Actions & Proceedings Law
It shall be a sufficient defense to the proceeding, if the owner or any mortgagee or lienor of record establish that:
The condition or conditions alleged in the petition did not in fact exist or that such condition or conditions have been removed or remedied; or
Such condition or conditions has been caused by a petitioning tenant or tenants or members of the family or families of such petitioner or petitioners or of their guests or by other residents of the dwelling or their families or guests; or
Any tenant or resident of the dwelling has refused entry to the owner or his agent to a portion of the premises for the purpose of correcting such condition or conditions.