The study of entanglement in gauge theories is expected to provide insights into many fundamental phenomena, including confinement. However, calculations of quantities related to entanglement in gauge theories are limited by ambiguities that stem from the non-factorizability of the Hilbert space. In this work we study lattice gauge theories that admit a dual description in terms of spin models, for which the replica trick and Rényi entropies are well defined. In the first part of this work, we explicitly perform the duality transformation in a replica geometry, deriving the structure of a replica space for a gauge theory. Then, in the second part, we calculate, by means of Monte Carlo simulations, the entropic c-function of the ℤ2 gauge theory in three spacetime dimensions, exploiting its dual description in terms of the three-dimensional Ising model.