In case an owner of real property upon which an improvement is being or has been made, desires to obtain a loan by executing and delivering a bond or bonds or note or notes secured by a mortgage upon such real property, or any part thereof, and in case lienors having mechanics' liens against such real property, or any part thereof, notices of which have been filed prior to the recording of such mortgage, and which said liens have not been discharged as in this article provided, shall, to the extent of at least fifty-five per centum of the aggregate amount for which notices of such liens have been so filed, by an instrument or instruments in writing, duly acknowledged, designate and authorize one or more persons to consent to the execution and delivery of such bond and mortgage or note and mortgage, and in case the consent in writing, duly acknowledged, of such person or persons to the execution and delivery of such bond and bonds and mortgage or note and notes and mortgage shall be filed in the office of the clerk of the county where such real property is situated, together with such instrument or instruments of designation, then all mechanics' liens for labor performed and materials furnished prior to the recording of such mortgage whether notices thereof have been theretofore or are thereafter filed, shall be subordinate to the lien of such bond or bonds and mortgage or note or notes and mortgage to the extent of the full amount which shall be advanced thereunder provided such mortgage contains the covenant prescribed in subdivision three of section thirteen of this chapter. In case such person or persons so designated and authorized shall so consent to the execution and delivery of such bond and mortgage or note and mortgage but on condition that a sum of money be deposited with the clerk of such county, and such sum is so deposited, the county clerk, upon such payment, shall forthwith enter upon the lien docket, indexed with the name of the owner, the facts relating to such payment. A deposit of money made as prescribed in this section shall be repaid to such owner or his assignee upon the discharge or release of all mechanics' liens, judgments and attachments against the property. All deposits of money made as provided in this section shall be considered as paid into court and shall be subject to the provisions of law relative to the payment of money into court and the surrender of such money by order of the court. The court shall in any action brought to foreclose any of such liens, or in any action brought to recover such deposit or any part thereof, direct the payment of such sum so deposited to the persons whose mechanics' liens, judgments, or claims secured by attachment shall have been established on the trial and the amount so paid shall be credited upon such mechanics' liens, judgments and claims. Upon such filing of such consent, as hereinbefore provided, the lien of all judgments and attachments affecting such real property and all claims and liens acquired in any proceedings upon such judgments shall be subordinate in like manner and to like extent as hereinbefore in this section provided for the subordination of mechanics' liens, and any attachment issued or judgment recovered upon a claim, which, in whole or in part, is not for materials furnished, labor performed or moneys advanced for the improvement of such property shall be subordinate to all mechanics' liens thereon, and shall also be subordinate to all judgments recovered upon and attachments issued upon claims for materials furnished, labor performed or moneys advanced for the improvement of such real property. Any lienor having a mechanic's lien against real property may subordinate such lien to any subsequent mortgage thereon by a certificate duly acknowledged or proved stating that such lien is subordinated, which certificate shall be filed in the office where the notice of lien is filed. Upon filing such certificate, the county clerk in the office where the same is filed shall note the fact of such filing in the "lien docket" in the column headed "proceedings had," opposite the docket of such lien.
N.Y. Lien Law § 29