The action was brought to foreclose a mechanic’s lien which the plaintiffs had filed against a building owned by the defendant Edward Judson. The Citizens’ Savings Bank, the respondent here, was "made a defendant, and .special relief, to which the plaintiffs claimed to be entitled, because of certain allegations contained in their complaint, was asked.’ against that bank. ’ The bank demurred to the complaint, and from the interlocutory judgment entered upon the decision sustaining the demurrer this appeal is taken.
The complaint contains the usual allegations in an action to foreclose a mechanic’s lien. The lien sought to be foreclosed was filed on the 27th day of December, 1895. It is alleged in the complaint that, on the 27th day of November, 1895, the defendant Edward Judson, the owner of the property described in the notice of lien, delivered to the Citizens’ Savings Bank a bond and mortgage to secure the sum of $70,000. This bond and mortgage, as alleged in the complaint, was delivered on an agreement between the Citizens’Savings Bank and Judson that the bank would advance to Judson from time to time, as certain work was done upon the buildings which were then erecting upon the premises, and when they had reached certain stages of completion, sums of money in installments as provided in a contract between them in regard to that matter.
It is alleged further that at the time of the commencement of the action there was earned, due and owing to- Judson from the Citizens’ Savings Bank, by virtue of said contract, the sum of $4,000, and that the same is wrongfully withheld by the Citizens’ Savings Bank, and that -the bank, refuses to pay over and deliver the same in satisfaction of the lien of the plaintiffs and other liens against the property, said sum being more than sufficient to pay to the plaintiffs herein the amount of their claim in full and to pay in full all prior liens of every nature and kind against said property.
*576In addition to the usual relief asked by plaintiffs in an action to foreclose a mechanic’s lienr the plaintiffs ask, as special relief against the Citizens’ Savings Bank, that it may be adjudged that it shall pay into court the said sum of $4,000 owing to Judson on the agreement.'
The demurrer by the bank is upon the ground that the complaint does not state facts sufficient to constitute a cause of action.
The substance of the allegation against the bank is that it made an agreement with Judson to advance to him money, from time to time, which he could use for' the purpose of completing- the buildings then in process of erection upon the premises described in the complaint. This agreement did not, of course, create any lien Upon the premises, but the lien was created by the bond and mortgage given to the Citizens’ Savings Bank, to be held by it as security for the advances after they had been made, and it is because the bond and mortgage was taken by the' bank as security for these advances that the plaintiffs claim the right to proceed against the bank in this action. . ' •
It is nowhere alleged in the complaint that the bank assumed any liability towards, the plaintiffs or made any promise for the benefit of the plaintiffs, and the question presented is whether a creditor having á lien upon the property of his debtor may bring an action to compel the performance by a third person. of his contract with the debtor to lend the debtor money. It is quite apparent that there is no privity between the plaintiff and the Citizens’ Savings Bank arising out of' the contract alleged in the complaint. The general rule applies here that one person cannot maintain an action . against another person to enforce a contract to which the plaintiff is not a party. The only exceptions to that rule are those found in the case- of Lawrence v. Fox (20 N. Y. 268) and cases of that nature. But this case does not come, and indeed is not claimed by the plaintiffs to come, within the principle laid down in that case, or any principle which has been deduced from it.
But the plaintiffs claim that although there is hot contractual privity between them and the Citizens’ Savings Bank, yet there is, by virtue of the Mechanics’ Lien Law, what they call a legal privity which 'enables them to ask in this action, as against this bank, for the relief asked in the. complaint. This legal privity arises, as they *577say, out of the provisions of section 17 of the Mechanics’ Lien Law. That section provides, among other things, that “ the plaintiff must make the ]3arties who have filed notice of liens against the property,, as well as those who have subsequent liens and claims by judgment,, mortgage or conveyance, q>arties defendant, * * * and all persons, firms, corporations or associations who have filed notice of liens under this act,' shall, by answer in such action, set forth the same; and the court in which the action is brought may settle and determine the equities of all the parties thereto, and decide as to the extent, justice and priority of the claims of all parties to the action, and upon every counterclaim or set-off alleged therein, to the extent of their respective jurisdictions.” (Laws of 1885, chap. 342, § 17; 3 R. S. [9th ed.] 2643.) The statute regulating actions to foreclose mechanics’ liens, while it is remedial in its nature, and is to be so interpreted as to permit the plaintiff to obtain all the relief which he can have under its provisions, nevertheless prescribes a scheme for the foreclosure of liens which is obligatory upon the courts and which must be observed by them. When the action is brought in a court of general jurisdiction, the court having acquired the right to act, pursuant to the 'statute, may give any relief which it might give in any other action, to the extent of its jurisdiction. But so far as the statute has given directions as to procedure in the action, those directions are binding upon the courts. The section which has been cited above contains certain directions as to procedure in the action, and, among other things, it prescribes who shall be jjarties to it. It is to be noticed that the only persons who can be made parties are those who are subsequent incumbrancers by mortgage and otherivise. The Citizens’ Savings Bank does not come within that provision. This mortgage was given on the 27th day of November, 1895, and the lien was not filed until the 27th day of December, 1895, just one month later. Therefore, the mortgage was an incumbrance prior to the lien, and the mortgagee was not properly brought into court under the provisions of section 17. But there is nothing in the provisions of this section which would authorize the court to adjudicate upon a claim such as is made here by the plaintiffs against this bank. The section authorizes the court to settle and determine the equities of all the parties in the action, and to decide as to the extent, justice and priority of the claims of all the parties. It is quite clear, *578In view of the context, that these equities are only such as arise by - reason of liens which exist upon the property and the- determination of which is necessary to the settlement of the rights of the parties . to the action. The claim which is made here. against the Citizens’ Savings Bank is not an equitable claim at all. It arises not .from the mortgage, but from the agreement, which is the principal contract between the bank and Judson, and which, so far as they are concerned, gives to Judson a'fight to recover at law the $4,000 if ■ the bank shall not pay it according to its contract. But there- is no equitable right involved in any aspect of the case, and.for that rea7 son the claim of the plaintiffs is not within the provisions of ¡section 17.
.' The Mechanics’ Lien Law establishes a complete system for the ¡foreclosure of such liens, and contains within itself full directions as to the nature of the relief which the plaintiff may have in an action. Jt authorizes the court to direct a foreclosure of the lien (§ 11), and ¡If, upon'the sale of the property to satisfy the-lien,, there shall be a ■deficiency, to give a personal judgment for the deficiency against, all persons who are liable therefor. (§ 23.) By section 15 it provides that whenever, for any reason, the claimant shall fail to establish his lien, he may, nevertheless, recover judgment against the. parties' to the action for such sums as maybe due to-him and which he might recover in an action upon a contract against such parties. It is only within this section,, if at all, that the plaintiffs- show any right to recover against the savings bank. But they have. clearly no right under that provision, because,, as we have seen, they have no contract with the savings bank and would not be entitled to recover anything in-an action upon a contract against it. The only liability which the savings bank is under, .if there is any liability upon its contract with •Judson, is to respond to him in damages for its failure to pay him the $4,000 in pursuance of its contract as set out in the complaint. " But, :as we have seen, that contract with- Judson gives no- rights, to the -plaintiffs. It is not apparent in any aspect of this case that the plaintiffs can acquire any right to maintain an action against the Oiti.zens’ Savings Bank by reason of any facts which are set out in the •complaint. The disposition of" the demurrer made by the learned judge below was correct, and the judgment entered upon his decís-, ion must be affirmed, with costs, with leave to the plaintiffs to *579amend their complaint upon the payment of costs of the demurrer, and of this appeal.
Van Brunt, P. J., Williams, Patterson and Ingraham, JJ., concurred.
Judgment affirmed, with costs, with leave to plaintiff to amend complaint on payment of costs of the demurrer and of this appeal.