If any tax on any real estate is paid by or collected from an occupant or tenant when there is some other person who, by agreement or otherwise, ought to pay the tax, or any part thereof, the occupant or tenant shall be entitled to recover by action the amount which the person should have paid with interest thereon, or the occupant or tenant may retain the same out of any rent due or accruing from the occupant or tenant to such person for real estate on which the tax is so paid.
ORS 311.285