OPINION OF THE COURT
Appeal from decision unanimously dismissed.
The tenant in this nonpayment proceeding resides in a building that receives Federal funds pursuant to the Section 8 Housing Assistance Payments Program for New Construction (24 CFR part 880). Tenant’s share of the contract rent is $218 per month. The total contract rent was $1,419 from July 1994 through September 1994 and $1,445 from October 1994 through May 1995. Landlord seeks in this proceeding to recover tenant’s share of the rent for the months from July 1994 to May 1995. As a defense and counterclaim, tenant asserts that landlord breached the warranty of habitability from the inception of the tenancy in 1992. Upon a pretrial oral application, the Housing Court ruled that the diminution in the value of the apartment was to be measured based on the contract rent rather than the tenant’s share of the contract rent (164 Mise 2d 756). After trial, the court ruled that tenant’s counterclaim would be allowed only for the months for which landlord seeks to recover rent (see also, Lin v Brabham, NYLJ, Jan. 17, 1996, at 34, col 2 [Civ Ct, Kings County, Gould, J.]). Finding that the rent owed was $2,398 and that the conditions in the apartment justified an award to tenant of $2,300, the court granted landlord a judgment for possession and $98. Landlord appeals from the court’s pretrial determination as to the measure of damages to be applied and from the final judgment.
The appeal from the pretrial determination is dismissed. Any right of direct appeal therefrom terminated with the entry of the final judgment (see, Matter of Aho, 39 NY2d 241).
The parties have stipulated that the sole issue to be determined on appeal is "whether the monetary basis for calculating rent abatement due to the breach in the warranty of habitability is the full contract rent * * * or whether the abatement should be calculated based upon the tenant’s share, as was originally demanded in the petition for nonpayment.” Before turning to this issue, however, we comment on the court’s limitation of tenant’s counterclaim to the months for which rent was sought by landlord.
In Park W. Mgt. Corp. v Mitchell (47 NY2d 316, 329) the Court of Appeals remarked that an award for breach of the warranty of habitability may be made in an independent action by tenant or as "a percentage reduction of the contracted-for rent as a setoff in summary nonpayment proceedings in which the tenant counterclaims or pleads as a defense breach by the landlord of his duty to maintain the premises in habitable condition.” The Court specifically refrained from commenting "upon the availability of other remedies” (at 329).
Although RPAPL 743 provides that "[t]he answer may contain any legal or equitable defense, or counterclaim,” the need for speedy dispositions in landlord-tenant matters ordinarily dictates that counterclaims be severed unless they are in essence a defense to landlord’s claim or so intertwined with such a defense as to become part and parcel thereof (see, Net Realty Holding Trust v Cidis, NYLJ, Dec. 7, 1990, at 29, col 2 [App Term, 9th & 10th Jud Dists]; Great Park Corp. v Goldberger, 41 Misc 2d 988). Where as here the same conditions provide the basis for the setoff against arrears and for the counterclaim for rent paid, the defense and counterclaim are part of the same extended transaction and the counterclaim should ordinarily not be severed (see, Sutton Fifty-Six Co. v Fridecky, 93 AD2d 720; 610 W. 142nd St. Owners Corp. v Braxton, 140 Misc 2d 826). This appears to be the case even where the lease contains a waiver-of-counterclaims clause (see, Sutton Fifty-Six Co. v Fridecky, supra; Net Realty Holding Trust v Ci-dis, supra). In the instant case, however, we are unable to grant tenant any relief on this basis in view of tenant’s failure to appeal and of the stipulation limiting the issues on appeal.
Turning to the issue raised by the parties, it is clear to us that the diminution in the value of the apartment must be measured by reference to the contract rent. It is the contract rent and not tenant’s share thereof which reflects the fair market value of the apartment (see, 42 USC § 1437f [c] [1]; 24 CFR 880.204 [Apr. 1995], removed 61 Fed Reg 13587). The application of a measure of damages based only on tenant’s share of the rent would result in landlord’s recovery of rent in excess of the value of what he has provided tenant.
To illustrate the point, let it be assumed that there had been a severe deprivation, such as that of heat and hot water, which
We find this result to be untenable. It is our view that a showing by tenant of a diminution in the value of the apartment defeats landlord’s claim for rent to the full extent of the diminution shown. As the Court of Appeals stated in Park W. Mgt. Corp. v Mitchell (47 NY2d 316, 329, supra), the obligation to pay rent is coextensive with landlord’s duty to maintain the premises. To the extent that landlord breached his duty to repair, there was no rent owed and no default in rent. In the instant case, therefore, it was properly determined that the only default in rent was in the sum of $98.
Although we are affirming, we hasten to add that we do not embrace tenant’s argument that a tenant should be allowed to recover damages for breach of the warranty of habitability in excess of his share of the rent (citing Renbel Mgt. Co. v Smith, M Trial Ct, Hampden Div, index No. SP-4384-S87). The Massachusetts Housing Court reasoned that tenants were third-party beneficiaries of the contract between HUD and landlord and that to deny tenants recovery would result in a windfall to landlord.
We have no quarrel with the proposition that tenant is a third-party beneficiary of the contract between HUD and landlord (see, Free v Landrieu, 666 F2d 698; Holbrook v Pitt, 643 F2d 1261). But we do not agree with tenant and with the Massachusetts court with respect to the effect of this status upon her rights, at least insofar as are involved in this case.
Tenant’s claim for breach of the warranty of habitability is predicated upon Real Property Law § 235-b, which implies the warranty into tenant’s lease with landlord. Real Property Law § 235-b (1) does not imply the warranty of habitability into the contract between HUD and landlord, which is not a "lease or rental agreement.” Moreover, the latter contract, although it does obligate landlord to maintain the premises in habitable condition, does not provide that tenant shall have a right of recovery for breach of this term. Therefore, in light of the rule that recovery for breach of the statutory warranty of habitability is dependent upon the obligation to pay rent by the party asserting the right to recover (see, Westway Plaza Assocs.
Still further complexities would be presented as to the measure of damages to be applied had tenant appealed with respect to its counterclaim for rent previously paid but in view of the failure to appeal we leave consideration of that problem for another day.
We reject landlord’s contention that tenant may not be awarded an abatement based on the full contract rent because such an award was not within the contemplation of the parties. In determining damages under Real Property Law § 235-b it is not what the parties contemplated but what the statute provides that governs. We also reject landlord’s contention that HUD is a necessary party inasmuch as we have found that it is only landlord’s claim for rent which has been defeated and there has been no affirmative recovery by tenant.
Scholnick, J. P., Chetta and Patterson, JJ., concur.