In case an owner of real property shall execute to one or more persons, or a corporation, as trustee or trustees, a bond and mortgage or a note and mortgage affecting such property in whole or in part, or an assignment of the moneys due or to become due under a contract for a building loan in relation to such property, and in case such mortgage, if any, shall be recorded in the office of the register of the county where such real property is situated, or if such county has no register then in the office of the clerk of such county, and in case such assignment, if any, shall be filed in the office of the clerk of the county where such real property is situated; and in case lienors having mechanics' liens against said real property, notices of which have been filed up to and not later than fifteen days after the recording of such mortgage or the filing of such assignment, and which 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 such notices of liens have been so filed, approve such bond and mortgage or such note and mortgage, if any, and such assignment, if any, by an instrument or instruments in writing, duly acknowledged and filed in the office of such county clerk, then all mechanics' liens for labor performed or material furnished prior to the recording of such mortgage or filing of such assignment, whether notices thereof have been theretofore or are thereafter filed and which have not been discharged as in this article provided, shall be subordinate to the lien of such trust bond and mortgage or such trust note and mortgage to the extent of the aggregate amount of all certificates of interest therein issued by such trustee or trustees, or their successors, for moneys loaned, materials furnished, labor performed and any other indebtedness incurred after said trust mortgage shall have been recorded, and for expenses in connection with said trust mortgage, and shall also be subordinate to the lien of the bond and mortgage or note and mortgage, given to secure the amount agreed to be advanced under such contract for a building loan to the extent of the amount which shall be advanced by the holder of such bond and mortgage or such note and mortgage to the trustee or trustees, or their successors, under such assignment. The provisions of this section shall apply to all bonds and mortgages and notes and mortgages and all assignments of moneys due, or to become due under building loan contracts executed by such owner, in like manner, and recorded or filed, from time to time as hereinbefore provided. In case of an assignment to trustees under the provisions of this section, the trustees and their successors shall be the agents of the assignor to receive and receipt for any and all sums advanced by the holder of the building loan bond and mortgage or the building loan note and mortgage under the building loan contract and such assignment. No lienor shall have any priority over the bond and mortgage or note and mortgage given to secure the money agreed to be advanced under a building loan contract or over the advances made thereunder, by reason of any act preceding the making and approval of such assignment.
N.Y. Lien Law § 26