This action is ejectment. The plaintiff claimed title under a devise in the will of his father, Daniel Dinan, and in his complaint alleged the devise as the source of his title. The defendant Hannah Coneys is the wife of the defendant William Coneys and the sister of the plaintiff. In her answer she denied that she unlawfully withheld possession of the premises, and alleged that by the will of Daniel Dinan the land devised to the plaintiff was charged with the payment to her of a legacy of three hundred dollars, which had not been paid, and she demanded judgment in her favor against the plaintiff for the amount of the legacy, with interest. The plaintiff replied, and, after admitting that the devise was subject to the charge, averred that the defendant had remained in the possession of the premises after the death of the testator, and received the rents and profits under an agreement with the plaintiff that they should be applied in payment of the legacy, and that the rents and profits received by her had been more than sufficient to satisfy it. The referee to whom the action was referred decided that the plaintiff was entitled to judgment for the possession of the premises, and the defendant Hannah Coneys to a judgment in her favor against the plaintiff for the amount of the legacy, with interest. Judgment was entered in conformity to the report. The plaintiff appealed. The General Term affirmed the judgment with a modification to the effect that the premises be sold to satisfy the legacy. The plaintiff then appealed to this court from the judgment rendered by the General Term.
The question presented is whether the legacy constituted a *Page 547 counterclaim under the Code. If it was not available as a counterclaim, the plaintiff did not by replying to the answer waive his right to take the objection on the trial, nor was he compelled to demur in order to raise the question. (Smith v.Hall, 67 N.Y. 48; People v. Dennison, 84 id. 273.) We think the legacy was not a counterclaim in the action, first, because it did not tend to diminish or defeat the plaintiff's recovery, and, second, because it was not a cause of action accruing out of the contract or transaction set forth in the complaint as the foundation of the plaintiff's claim, nor was it connected with the subject of the action. (Code, § 501.) The plaintiff by the acceptance of the devise became personally liable as upon contract, to pay the legacy (Brown v. Knapp, 79 N.Y. 136), and it was a charge also upon the land, which could be enforced in equity. But the fact that the plaintiff had become personally bound to pay the legacy did not make the legacy a counterclaim under the second subdivision of section 501, as that subdivision only applies where the action of the plaintiff is on contract also. The subject-matter of the plaintiff's action was the alleged right of possession of the land sought to be recovered. The subject-matter of the counterclaim was the right to recover against the plaintiff the amount of the legacy, and also (in view of the modification made by the General Term) the right to relief by sale of the land for its payment. The right of the plaintiff to possession of the land was in no way qualified by the fact that a legacy was charged thereon. The existence of the legacy gave the legatee no right of possession as against the plaintiff, whether the legacy was paid or not, and being in possession did not justify her in withholding possession from the plaintiff, the owner of the legal title. Nor did the existence of the legacy tend in any way to diminish or defeat the plaintiff's recovery. He took an incumbered title, but he had a right to the possession and the existence of the incumbrance in no way affected that right. The defendant Hannah Coneys was not in the situation of a mortgagee in possession. The mortgagee under the old law had a defeasible estate *Page 548 in the land mortgaged, and being in possession could defend his possession under the mortgage; and the change made by our law, which makes the mortgage a security merely, has not abrogated the mortgagee's right when in possession of the pledge, to retain it after default, until the debt for which the mortgage is held shall be satisfied. This rule is justified by the presumed intention of the parties and the nature of the transaction. But a legatee, whose legacy is charged on land, holds no relation thereto corresponding with that of a mortgagee in possession. He has it is true a lien. So has a judgment creditor. But it could not be claimed that the latter could before sale lawfully take possession of the lands of the judgment debtor under the judgment, or defend an ejectment brought by him to recover it. One of the definitions of a counterclaim in the 2nd subdivision of section 501 is "a cause of action arising out of the contract or transaction set forth in the complaint as the foundation of the plaintiff's claim." The transaction set forth in the complaint as the foundation of the plaintiff's claim is title acquired under the devise in the will of Daniel Dinan and the withholding of possession by the defendants. Upon that title he founds his right to the possession of the land. The legacy given to Hannah Coneys is given by the same will, and is thereby charged on the land devised to the plaintiff. But the right of the plaintiff to the possession of the land, and of the defendant to the legacy are wholly distinct and independent claims. The giving of the legacy, as has been said, did not qualify the devise so as to affect the right of possession. The claim of the legatee does not arise out of the transaction upon which the plaintiff relies, although both claims had a common origin and were coincident in the time of their creation. Moreover, under both subdivisions of section 501, the counterclaim presented must "tend in some way to diminish or defeat the plaintiff's recovery." The right of the plaintiff to recover the possession of the land is neither diminished nor defeated by the existence of the legacy. He is entitled to possession, *Page 549 notwithstanding the legacy, and this the judgment awards him.
We think the original judgment against the plaintiff was not sanctioned by the law of counterclaim, and that the modification by the General Term, which turns the defense into an action in equity to enforce the charge, was a still further departure from the statute. While the statute of counterclaim ought to be liberally construed in the interest of peace and to suppress unnecessary litigation, it does not, we think, justify the application made in this case.
The judgments of the courts below should be reversed and a new trial ordered, with costs to abide the event.
All concur.
Judgments reversed.