Section 12C. If a tenant paying rent for real estate is taxed therefor he may retain out of his rent the taxes paid by him, or may recover the same in an action against his landlord, unless there is a different agreement between them.