A landlord in New York City forfeits the right to enforce the "no pet" clause in the standard form of lease, when the landlord does not start the actual court case within the first three month period following the landlord's knowledge of the harboring of the dog. The knowledge of the building employees is imputed to the landlord.
As a pet owner in NYC you should have made yourself familiar with your right to keep your pet, notwithstanding the lease.
I agree with my colleague that the law is on your side and that you should obtain legal assistance. In this type of case, knowing that the law is on your side may not be enough unless you have the ability to prove your case in court. Getting building employees to admit that they knew about your dog can be difficult. In my experience, the building super will not willingly testify against his boss. Don't bother contacting the landlord ahead of time: if they really want to sue you, they will no matter what you say. You would only be letting them know early on which employees could help your case.
I am not your attorney, and I am not providing legal advice to you or any reader. Find your local bar association online and contact it for referrals of qualified lawyers in your area. I do not provide answers to legal questions not involving New York state law.