N.Y. Real Property Actions & Proceedings Law § 771
5. Manner of service. a. Service of the notice of petition and petition shall be made by personally delivering them to the person or persons required to be served pursuant to subdivision three of this section. Service upon the city of New York shall be made by personal delivery to the commissioner of the city department charged with enforcement of the housing maintenance code of such city, or to an agent duly authorized to accept such service on his behalf. If service cannot with due diligence be made within the city upon an owner, mortgagee or lienor of record in such manner, it shall be made: