4. Notwithstanding any provision of law, no municipality whose population is five thousand or more, whatever may be the general or special act under which it is constituted, may levy, by by-law, resolution or ordinance, a tax, duty or assessment upon any person working at any work whatsoever within the limits of its territory, for the sole reason that such person does not reside or is not domiciled in such territory.
R. S. 1964, c. 174, s. 14.