This action was brought for the partition of a certain two-family house in the borough of The Bronx owned by plaintiff and the appellant as tenants in common. In his answer defendant interposed a defense and a counterclaim which virtually embody the same state of facts. The plaintiff demurred to both the defense and the counterclaim. The justice at Special Term overruled the demurrer so far as the defense was concerned and sustained it as to the counterclaim.
The facts set out in the defense and counterclaim are substantially as follows: That on or about December 1, 1917, the plaintiff and-defendant in order that they might acquire for themselves respectively a permanent residence, entered into an agreement for the purchase as tenants in common of a two-family building known as 952 Whitlock avenue in the borough of The Bronx; that thereafter and on or about the 5th of December, 1917, the parties duly became, and have ever since been and now are the owners in fee and tenants in comrnon of the said premises; that by the terms of the agreement between the parties, it was among other things agreed “ that should either of the parties thereto desire to sell his interest in the said property, * * * he should give written notice of such desire to the other and that such other party should then have the privilege of purchasing the one-half interest of the retiring party, and that the amount to be paid for the one-half interest of the retiring party should be computed upon the basis that the value of the joint property should be seven thousand six hundred ($7,600) dollars, and that the amount of cash to be *260paid to the retiring party should be one-half of the equity in such property after deducting all incumbrances that might be chargeable against such property at the time and that if the remaining party should elect to purchase the interest of the retiring party upon such terms he should give notice of such an election in writing to the retiring party within ten (10) days after he should receive such notice, and that the closing of title should be fixed for a date which should be thirty days after the notice of election to buy.” It is further alleged in the answer that the plaintiff commenced this action by the service of a summons and complaint on or about October 24, 1919, in which he demanded judgment, among other things, that the premises in question be sold under the direction of the court and that after the payment of certain proper charges against the premises “ the residue of the moneys derived upon such sale be divided equally between the plaintiff and this defendant; ” that thereafter and on the 30th of October, 1919, the defendant gave plaintiff notice in writing of his election to buy the one-half interest of the plaintiff upon the terms set forth in the agreement between them as above quoted, “ but that the plaintiff has refused and failed and still refuses and fails and has notified this defendant of his refusal hereafter to deliver to this defendant a deed of conveyance of his interest in said premises * * * as fixed by this defendant in said notice, or at any other time.”
As was said by the court at Special Term, “ the agreement * * * very clearly was designed merely to accomplish the purpose of the parties to it that each of them should have the right to purchase the other’s interest, before that other should have the right to sell to a stranger.”
We are entirely in accord with the learned justice in the conclusion that he reached as to the intentions of the parties and that the agreement of the parties virtually contemplated that neither party may partition without first giving notice to the other tenant in common of his desire to sell to afford the latter an opportunity to purchase as provided by the agreement. An agreement not to bring an action in partition is valid, and where such an agreement is made it is a good defense to an action to partition. (Buschmann v. McDermott, 154 App. Div. 517.)
*261Coming now to the question as to whether the counterclaim sets forth a cause of action, we find that the agreement of the parties was “ that should either of the parties thereto desire to sell his interest in the said property * * * he should give written notice,” etc. The complaint in the partition action which the plaintiff brought is in writing and verified by the plaintiff. The complaint sets forth that each of the parties “ is seized and possessed in fee of an undivided one-half part of said premises; ” that an “ actual partition cannot be had, and that a sale thereof is necessary,” and in the prayer the plaintiff asks inter alia “ that said premises be sold by or under the direction of the court ” and that “ the residue of said moneys arising from said sale be divided and paid as follows: one-half thereof to the plaintiff and one-half thereof to the defendant Harris Funk.”
The complaint thus in unequivocal language expresses the desire of plaintiff to sell his interest in the said property which is in effect equivalent to a written notice from him to the defendant of his desire to sell his interest as provided for in the agreement. That the desire of plaintiff to sell his half interest in the property was communicated to the defendant through the instrumentality of a complaint, to the truth of which he solemnly swore, rather than through the medium of an ordinary written notice out of court, should not weaken its effect.
It is quite evident that the partition action is brought for the purpose of defeating the right of the defendant to buy plaintiff’s interest upon the terms mentioned in the contract. Indeed, the learned counsel for the respondent concedes as much in his brief. His contention is, however, that the bringing of the action is not the equivalent of a notice as required by the agreement between the parties and that a counterclaim which arises after the commencement of an action is not available to the defendant.
We have already shown that the complaint is a notice within the terms of the agreement of plaintiff’s desire to sell his one-half interest. As to defendant’s right to assert a counterclaim which arose after the commencement of the action, we need only refer to section 501 of the Code of Civil Procedure which defines a counterclaim. That section states, *262among other things, that a counterclaim “ must be one of the following causes of action against the plaintiff * * *: 1. A cause of action arising 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. 2. In an action on contract, any other cause of action on contract, existing at the commencement of the action.”
It will be observed that this counterclaim comes within the 1st subdivision of section 501 above quoted, which says nothing about a cause of action existing at the commencement of the action. The counterclaim in this case clearly arose out of the contract or transaction set forth in the complaint, and since there is nothing stated in subdivision 1 which requires that the counterclaim must exist at the commencement of an action, we are of opinion that the counterclaim sufficiently states a cause of action and that the demurrer should have been overruled.
The order, so far as appealed from, must be reversed, with ten dollars costs and disbursements, and the demurrer overruled, with ten dollars costs, with leave to plaintiff to withdraw the demurrer and to reply on payment of said costs.
Clarke, P. J., Laughlin and Merrell, JJ., concur; Dowling, J., dissents.