[4] Besides the warranty of habitability retaliation claim, Brown raised the affirmative defense of illegal retaliation{**62 Misc 3d at 284} under Real Property Law § 223-b (1) (a). This provision forbids a landlord from serving a notice to quit because a tenant made a good faith complaint to governmental authorities concerning the landlord's alleged violation of a health or safety law. The elements to establish a prima facie case for this defense are identical to Real Property Law § 223-b (1) (b) except for the first element. The first element of a defense under section 223-b (1) (a) requires that the tenant made a complaint to a governmental authority of the landlord's alleged violation of any health or safety law.
Thus, to make out the affirmative defense under Real Property Law § 223-b (1) (a), the tenant must show: (1) the tenant made a complaint to a governmental authority of the landlord's alleged violation of any health or safety rule, regulation, code, law or ordinance; (2) such complaint was undertaken in good faith; (3) the landlord was aware of the tenant's complaint; and (4) if the tenant's action took place within the six month period before being served with a notice to quit, then the landlord's refusal to renew the lease is presumed to have been in retaliation for the tenant's complaint or (5) if the tenant's complaint took place longer than six months before being served with a notice to quit, then the tenant must prove that the landlord's decision not to renew the lease was in retaliation for the tenant's action.