This action was brought for the partition of certain real estate situate in the city of New York, and for an accounting of the rents and profits received therefrom by the respondent. The answer of the respondent did not deny the material allegations of the complaint, but alleged, as a second and separate defense, and by way of counterclaim, that she was formerly the wife of one John B. Williams, who died in 1891, and the mother of the plaintiff; that when said Williams died he was seised of the real estate described in-the complaint, and “much other real property”; that the plaintiff was then an infant about the age of 12 years, and resided and continued to reside with her until about the xst of June, 1901; that when her husband died she did not then or at any time thereafter have sufficient means of her own to maintain, support, and educate the plaintiff, and by reason thereof had been compelled to, and did, depend upon and resort to his property for that purpose; that she- had paid out and expended therefor, in the aggregate, $4,549.80. And as a third and separate defense, and also by way of counterclaim, that when her husband died he was the owner of certain real estate in the state of New Jersey, which at the time of the commencement of the action was owned in common by her, the plaintiff, and the defendant Jessie M. Williams; that since the xst of June, 1901, the plaintiff had used and occupied, without paying any rent therefor, a dwelling house situate thereon, the reasonable value and use of which was $15 per month; and that he had not paid or accounted for such use. And she asked, by reason of such facts, that she be allowed for the moneys paid out and expended for the support, maintenance, and education of the plaintiff, and for her proportionate share of the rents of the property occupied by him, and have a judgment therefor, which should be declared to-be a lien upon the share or interest of the plaintiff in the real estate described in the complaint, and on the moneys derived from the sale thereof. The plaintiff demurred to each of these defenses upon the ground that they were not of the character specified in section 501 of the1 Code of Civil Procedure. The demurrer was overruled, and thereafter an interlocutory judgment was entered, from which the present appeal is taken.
We are of the opinion the demurrer should have been sustained. As to the second defense and counterclaim demurred to, there is no allegation in it to the effect that the moneys claimed to have been advanced by the defendant for the education and maintenance of the *383plaintiff were derived from the rents of the real estate described in the complaint. If it be true that the defendant, at the time of the death of her husband, did not have means of her own sufficient to support and educate the plaintiff, then she, as his guardian in socage, had the right to use so much of his property as was necessary for that purpose. Before doing so, however, she should have applied to the court for permission to do so. It does not appear that she made such application, but that fact does not now necessarily prevent the court, inasmuch as the plaintiff has asked her to account for such rents, from making the proper allowance in this action, and thus doing justice between the parties. Before such allowance can be made, however, proof must be offered from which the court can find as a fact that the amounts which she paid out for the plaintiff, or some of them, were derived from the rents and profits of the real estate described in the complaint. There is no allegation in the complaint to that effect, and therefore such proof would be inadmissible. The allegations of this defense are that the husband of the defendant not only died seised of the real estate described in the complaint, but much other real estate; and, for aught that appears, all of the moneys which the defendant paid out for the plaintiff were derived from his personal property, or the rents and profits of real estate other than that described in the complaint; and, if so, then it is not a proper counterclaim in this action, under section 501 of the Code of Civil Procedure. To be the proper. subject of counterclaim under this section of the Code, the defense;, if established, must tend in some way to defeat the plaintiff’s recovery; and to do that it must be a cause of action arising out of the transaction set out in the complaint, or connected with the subject-matter of the action. Unless the moneys alleged to have been expended were derived from the rent of the real estate sought to be partitioned, then the same do not arise out of the transaction set forth in the complaint, and are not connected with the subject-matter of the action in any way, and therefore are not the proper subject of a counterclaim.
The counterclaim attempted to be set up in the third separate defense is not of the character specified in section 501 of the Code. Here what the defendant seeks to recover is her proportionate share of the use of the real estate which the plaintiff has occupied in New Jersey. It is in no way connected with the subject-matter of the action, and is not the proper subject of counterclaim in this action. It does not tend, if established, to diminish or defeat the plaintiff’s recovery. It is a cause of action, if it exists at all, which does not arise out of the transaction set forth in the complaint, nor is it connected with the subject-matter of the action in any way. Lipman v. Jackson Architectural Iron Works, 128 N. Y. 58, 27 N. E. 975.
We are of the opinion, therefore, that the interlocutory judgment must be reversed, with costs, and the demurrer sustained, with costs, with leave to the defendant to amend her answer bn payment of costs in this court and in the court below. All concur.