A comaker or surety, when sued alone, may, with the consent of the comaker or principal, make use of by way of counterclaim of a debt or liquidated demand due from the plaintiff at the commencement of the action to such comaker or principal, but the plaintiff may meet such counterclaim in the same way as if made by the comaker or principal.
Iowa Code § 619.6