In the district courts, the defendant may allege in defense any facts which would entitle him in equity to be absolutely and unconditionally relieved against the plaintiff's claim or cause of action or against a judgment recovered by the plaintiff in such action.
Mass. Gen. Laws ch. 231, § 31