Section 60. If a person other than the owner of the fee rightfully pays the taxes assessed on land to the collector or treasurer, before a taking or sale, the collector or treasurer shall at the request of the person so paying give him a certificate of such payment stating the name of the person to whom the land is taxed, of the person paying the tax, and a substantially accurate description of the land. Such collector or treasurer shall charge one dollar for each certificate so issued, and the money so received shall be paid into the town treasury. Such certificate being recorded in the registry of deeds within thirty days from its date shall be notice to all persons of such payment and of the lien therefor. A person whose tax is paid by another shall upon repaying the same have the same right to recover it from the town, if illegally assessed, which he would have had if the tax had been paid by him under written protest.