
    THE METROPOLITAN TRUST COMPANY OF THE CITY OF NEW YORK, Appellant, v. THE TONAWANDA VALLEY AND CUBA RAILROAD COMPANY and Others, THE FARMERS’ LOAN AND TRUST COMPANY, Impleaded, Respondents.
    
      Action to foreclose a mortgage — senior incumbrancers may be made parties defendant— right of such an incumbrancer to demand a foreclosure of his mortgage as a counterclaim — Oode of Oiml Procedure, sees. 500, 521.
    This action was brought to foreclose a mortgage given by the Tonawanda Yalley and Cuba Railroad Company, a corporation formed by the consolidation of three companies, known as the Tonawanda Yalley Railroad Company, the TonawandaYalley Extension Railroad Company and the Tonawanda Yalley and Cuba Railroad Company. The new company assumed the payment of certain bonds theretofore issued by the Tonawanda Yalley Railroad Company and the Tonawanda Yalley Extension Railroad Company, payment of which was secured by mortgages upon the property and railroad of each of said companies, given by them to trustees. The plaintiff made the trustees of these two mortgages parties defendant, and sought to have the amount of the outstanding bonds determined in order that they might be paid out of the proceeds of the sale, or that the sale might be made subject to such lien, as might be just and proper. The defendant, The Farmers’ Loan and Trust Company, the trustee of the mortgage given by the Tonawanda Yalley Railroad Company served an answer, alleging all the facts essential to the maintenance of an action to foreclose the mortgage given by that company to it, and demanded a judgment for tlie usual relief in such case, which answer was served upoD the attorney for the plaintiff and the other defendants.
    Upon the report of a referee finding all the facts requisite to the foreclosure of both mortgages, and that the plaintiff’s mortgagor was insolvent and that its road could not be sold in parcels without prejudice to the interests of the bondholders, a judgment was entered directing that the property embraced in the plaintiff’s mortgage be sold as an entirety, subject to the Tonawanda Valley Extension Railroad Company’s mortgage; and that unless the purchaser, within ninety days, should pay the amount secured by the Tonawanda Valley Railroad Company, with costs, that the property covered by the last mentioned mortgage might be sold separately to pay off the amount due on it, with costs, and that the purchaser of the entire property should not receive a deed for the entire properly, pursuant to such sale, until the Tonawanda Valley Railroad Company’s mortgage, with costs, should have been paid, unless such deed, by its terms, should be made expressly subject to the provisions of the judgment in regard to a separate sale of the property embraced in the Tonawanda Valley Railroad Company’s mortgage in case of the failure of the purchaser to pay it.
    
      Held, that the defendant trustee could properly set up in the answer, and make available by the judgment, the matter alleged, and the demand for affirmative relief by way of foreclosure of its mortgage and a sale of the premises and property covered by it.
    That as the alleged claim of the defendant embraced both a cause of action against the plaintiff and against some of the co-defendants, and was connected with the subject of the action, and in some degree might go to diminish the plaintiff’s recovery, as measured by the relief within the demand and allegations of the complaint, the relief asked for and obtained by this defendant came within the moaning of a counter-claim as defined in the Code of Civil Procedure.
    That the practice, as applied to a case of this character, and the judgment, as rendered therein, were not in contravention of any provision of the statute providing for the foreclosure' of mortgages by action and the sale of the premises pursuant to judgments therein.
    Appeal by the plaintiff from a portion of a judgment entered in Allegany county on the report of a referee.
    The action was brought to foreclose a mortgage made by the defendant, the Tonawanda Valley and Cuba Railroad Company, to James D. Fish, as trustee, to secure the payment of its bonds to the amount of $500,000; the plaintiff was afterwards substituted in' place of Fish as such mortgagee.
    That railroad company was created by the consolidation of three companies before then organized, known as the Tonawanda Valley Railroad Company, tlie Tonawanda Valley Extension Railroad Company, and tlie Tonawanda Yalley and Cuba Railroad Company. Before such consolidation, the Tonawanda Yalley Railroad Company had made á mortgage upon its railroad and property to the defendant, the Farmers’ Loan %nd Trust Company, as trustee, to seciire the payment of its bonds to the amount of § LOO,000 ; and the Tonawanda Yalley Extension Railroad Company had made a mortgage on its railroad and property to the defendant James D. Fish, as trustee, to secure the payment of its bonds to the amount of §70,000. When the defendant railroad company was organized, it assumed the payment of the bonds of those other companies, then outstanding; and at the time of the commencement of this action, default had been made in the payment of the interest on the bonds of all those companies.
    The plaintiff in the complaint alleges a desire to have the amount of the outstanding bonds of the Tonawanda Yalley and the Tonawanda Yalley Extension Railroad companies, and the extent of the lien of those prior mortgages, and each of them, ascertained and determined, that the amount of them may be paid out of the proceeds of the sale, or that the premises and property covered by them may be sold subject to such lien, as may be just and proper, and that the Farmers’ Loan and Trust Company and Fish are made parties defendant for that purpose. It is alleged in the complaint that defendant railroad company has made default in the payment of interest upon its outstanding bonds and those of the other companies ; and amongst other relief, the plaintiff demands judgment directing a sale to be made “ subject to the lien of the said prior mortgages to the said, the Farmers’ Loan and Trust Company and James D. Fish, as trustee as aforesaid, on the promises covered by them; or that the amount of said lien be paid, satisfied and discharged out of the proceeds of such sale, as may be for the best interests of the parties to this action.”
    The defendant, the Farmers’ Loan and Trust Company, by answer alleges, amongst other things, all the facts essential to the maintenance of an action to foreclose the mortgage made by the Tonawanda Yalley Railroad Company to it, and demands judgment for the usual relief in such case, which answer was served upon the attorneys for the plaintiff and the other defendants.
    The referee found all the facts requisite to the foreclosure of both mortgages, also that the defendant railroad company is insolvent ; that its road could not be sold in parcels without prejudice to the interests of the bondholders, and directed judgment of foreclosure of the plaintiff’s mortgage, and of the Farmers’ Loan and Trust Company mortgage, with qualified provisions as to the sale, which, as declared by the judgment, were that the property embraced in the plaintiff’s mortgage be sold as an entirety, subject to the Tonawanda Yalley Extension Railroad Company mortgage, and unless the purchaser, within ninety days, should pay the amount secured by the Tonawanda Yalley Railroad Company mortgage, with costs, that the property covered by the last mentioned mortgage may be sold separately to pay off the amount due on it, with costs, and that the purchaser of the entire property shall not receive a deed.for the entire property, pursuant to such sale, until the Tonawanda Yalley Railroad Company mortgage, with costs, shall have been paid, unless such deed by its terms shall be made expressly subject to the provision of the judgment in regard to a separate sale of the property embraced in the Tonawanda Yalley Railroad Company mortgage in case of failure of the purchaser to pay it. And the judgment contains various other provisions, to which it is unnecessary to particularly refer for the purposes of the questions here.
    The plaintiff took exceptions to the conclusions of law, and to refusal to find as requested. The plaintiff appeals from the part of the judgment granting such relief to the defendant.
    
      Thomas G. Hillhouse., for the appellant.
    
      Herbert B. Ttorner, for the respondents.
   Bradley, J.:

The plaintiff was at liberty to make the senior mortgagees parties defendant so as to have the amount secured by their mortgages ascertained and determined by the judgment, that they might be paid out of the proceeds of the sale, and their lien discharged, or that the sale might be made subject to the known amount of their liens. (Western Ins. Co. v. Eagle Fire Ins. Co., 1 Paige, 284; Vanderkemp v. Shelton, 11 id., 29 ; Holcomb v. Holcomb, 2 Barb., 20 ; Emigrant Industrial Savings Bank v. Goldman, 75 N. Y., 127.) The desire expressed in the complaint is to have .the amount of those mortgages ascertained, that the amount may be paid out of the proceeds of the sale, or that the premises may be sold subject to their liens, and judgment is in like manner in the alternative demanded.

The question is, whether the defendant, the Farmers’ Loan and Trust Company, could properly set up in the answer, and make available by the judgment, the matter alleged, and the demand for affirmative relief by way of foreclosure of its mortgage, and sale of the premises and property covered by it. This defendant could have brought its action in the nature of a cross bill for such relief. The right to seek it as a defendant, is dependent wholly upon the statute. And the inquiry arises whether it is a counter-claim within the meaning of the statute, which provides that the answer may contain a statement of new matter constituting a counter-claim ( Code Civil Pro., § 500), that the counter-claim “ must tend in some way to diminish or defeat the plaintiff’s recovery,” and must be a cause of action “ against the plaintiff, or, in a proper case, against the person whom he represents, and in favor of the defendant, or of one or more defendants, between whom and the plaintiff a separate judgment may be had in the action.” And such cause of action must arise “out of the contract, or transaction set forth in the complaint as the foundation of the plaintiff’s claim, or connected with the subject of the action; ” or 2. “ In an action on contract, any other cause of action on contract, existing at the compiencemerit of the action.” (Id., § 501.) And in such case, when entitled thereto the defendant may have judgment for the affirmative relief demanded in the answer. (Id., § 504.) The subject of the plaintiff’s action is the mortgage made by the consolidated company, and the property covered by it, which embraces that in the senior mortgage of the defendant, and the purpose of the action is to foreclose the mortgage, and sell the property. It is contended, on the part of the plaintiff, that the cause of action alleged in the answer is not a cause of action against the plaintiff, and does not tend to diminish, or defeat the plaintiff’s recovery, and that it is not connected with the subject of the action.

The plaintiff, as a junior mortgagee, would be a necessary party defendant, in an action to foreclose the senior mortgage. That situation seems to be sufficient to constitute a cause of action against the plaintiff within the meaning of the statute. The affirmative relief demanded by the answer, and given by the judgment, in some sense qualifies or diminishes the plaintiff’s recovery in view of the allegations of the complaint and the relief demanded by it, and yet preserves all the rights to which the junior mortgagee is entitled, and affords to the senior one only such priority as it is entitled to. And this is a legitimate result, if the matter alleged in the answer is in other respects within the requirement of a counter-claim.

In Vassear v. Livingston (13 N. Y., 248), the plaintiff was not a proper party to any action in favor of the defendant upon the claim alleged; and it was not a counter-claim, because it was no cause of action against the plaintiff. And to the same effect is Frick v. White (57 N. Y., 103-107). While the defendant is not a necessary party defendant to the action for the foreclosure of the plaintiff’s mortgage, and the defendant’s cause of action may not arise out of the contract or transaction set forth in the complaint as the foundation of the plaintiff’s claim, it seems to be connected with the subject of the action. The requisite of connection of the defendant’s cause of action with the subject of the plaintiff’s action is not defined or restricted by the provisions of the statute. There must only be some connection. And it has been said that it “ must have such relation to, and connection with, the subject of the action, that it will be just and equitable that the controversy between the parties as to the matters alleged in the complaint and in the counterclaim, should be settled in one action, by one litigation.” (Carpenter v. Manhattan Life Ins. Co., 93 N. Y., 556)

The theory and policy of the statute, providing for the disposition of controversies by actions, is that the rights of all parties to an action as between the plaintiff and all or any of the defendants, and as between the defendants themselves, shall be adjusted and declared by the judgment, when the relation between them and the subjects involved, are such as to permit it to be done within the practice prescribed. (Code Civil Pro., § 1204; Derham v. Lee, 87 N. Y., 599.)

In Rafferty v. Williams (34 Hun, 544), cited by the plaintiff’s, counsel, the controversy presented by the answer was wholly between the defendants, and had no relation to the subject of the action ; and the court held that it was not within section 1204 of the Code. But prior to the present Code, the affirmative relief sought by the defendant in this action was not available as a counter-claim, because the practice did not provide for service of pleadings by one defendant upon another, and thus permit to be brought before the court, upon the cause of action so alleged by a defendant, the other parties defendant requisite to the determination of the claim. The statute now, in view of such practice, provides that “ where the judgment may determine the ultimate rights of two or more defendants as between themselves, a defendant who requires such a determination, must demand it in his answer, and must, at least twenty days before the trial, serve a copy of his answer upon the attorney for each of the defendants affected by the determination,” etc, (Code Civil Pro., § 521.) This service was made, and all the parties requisite to the relief, so far as appears, were thus brought into the con-, troversy tendered by the defendants answer of the alleged counterclaim. That section and this proceeding under it extended the application and practical effect of Code of Civil Procedure (§ 1204). (Kenney v. Apgar, 93 N. Y., 539, 547). And as the alleged claim of the defendant embraces both a cause of action against the plaintiff and against some of the co-defendants, and is connected with the subject of the action, and in some degree may go to diminish the plaintiff’s recovery as measured by the relief within the demand and allegations of the complaint, the relief asked for and obtained by this defendant seems to come within the meaning of the statute defining a counter-claim. This does not necessarily result from, or require the conclusion of any enlargement of the power of the court by the provisions of section 521; but, as a matter of practice, extended and regulated by that section, the manner of the exercise of the power of the court is enlarged and the means are provided to parties defendant in proper cases to extend the operation and effect of the provisions of section 1204, and embrace within the term counter-claim some claims which, before then, the practice provided by the statute did not permit to be made available as such. (Albany Savings Inst. v. Burdick, 87 N. Y., 40.)

The practice as applied to a case of this character, and the judgment as rendered in this action, we think, are not in contravention of any provision of the statute providing for the foreclosure of mortgages by action and the sale of the premises pursuant to judgments therein. And there seems to be no impropriety in providing for and pursuing the practice adopted in this case. The rights of the parties are as effectually preserved in the one as they could have been in two distinct actions; and it is not seen that the interest of the parties represented by the plaintiff are prejudiced by the dual relief given by the judgment.

There is no force in the objection that the answer did not, in express terms, define as a counter-claim the matter set up as such, inasmuch as it distinctly appears by the relief demanded that it was intended as a counter-claim. None of the plaintiff’s exceptions presented here for consideration seem to have been well taken.

The portion of the judgment appealed from should be affirmed.

Barker and Haigiit, JJ., concurred; Smith, R. J., not sitting.

Judgment affirmed, with costs.  