Section 8A. In any action under this chapter to recover possession of any premises rented or leased for dwelling purposes, brought pursuant to a notice to quit for nonpayment of rent, or where the tenancy has been terminated without fault of the tenant or occupant, the tenant or occupant shall be entitled to raise, by defense or counterclaim, any claim against the plaintiff relating to or arising out of such property, rental, tenancy, or occupancy for breach of warranty, for a breach of any material provision of the rental agreement, or for a violation of any other law. The amounts which the tenant or occupant may claim hereunder shall include, but shall not be limited to, the difference between the agreed upon rent and the fair value of the use and occupation of the premises, and any amounts reasonably spent by the tenant or occupant pursuant to section one hundred and twenty-seven L of chapter one hundred and eleven and such other damages as may be authorized by any law having as its objective the regulation of residential premises.