Any person having a junior lien upon the mortgaged premises or any part thereof or interest therein, may, at any time before such sale, pay to the clerk of court, or the plaintiff or the plaintiff's assignee, the amount of such judgment, taxes, interest and costs, and costs subsequent to judgment, and shall thereupon be subrogated to all the rights of the plaintiff as to such judgment.
Wis. Stat. § 846.15