The court may order the amount found due the plaintiff for rents and profits or costs, if any, to be deducted from the amount found due the defendant, to whom the balance only shall be paid from any money tendered or brought into court, and the residue, if any, shall be paid to the plaintiff.
Mass. Gen. Laws ch. 244, § 31