(a) Judgments for the recovery of money may be set off against each other, having due regard to the legal and equitable rights of all persons interested in both judgments.
(b) The setoff may be ordered upon motion after reasonable notice to the adverse party, where both judgments are in the same court, or in an action for equitable relief in the court in which the judgment sought to be annulled by the setoff was rendered.