If the defendant or his heirs or assigns, after the land is so relinquished to him, are evicted therefrom by force of a better title than that of the original plaintiff, the person so evicted may recover in a civil action from such plaintiff, or from his executors, administrators, heirs or devisees under chapter one hundred and ninety-seven, the amount so paid for the land, with lawful interest thereon; but in order to be so entitled to recover, the defendant or those holding under him shall give notice to the person so liable to refund the purchase money of the pendency of the action for the recovery of the land, so that he may offer evidence tending to prove that the original plaintiff had the better title.
Mass. Gen. Laws ch. 237, § 35