N.Y. Real Property Actions & Proceedings Law § 881
3. The purposes for which a licensee may seek permission to enter an adjoining property pursuant to this section may include:
4. The grant of any permission pursuant to this section shall be subject to the following conditions:
5. The court, in granting a license or otherwise resolving a proceeding brought pursuant to this section, shall be authorized to: