We study the different ways of introducing light-matter interaction in first-principle tight-binding (TB) models. The standard way of describing optical properties is the velocity gauge, defined by linear coupling to the vector potential. In finite systems a transformation to represent the electromagnetic radiation by the electric field instead is possible, albeit subtleties arise in periodic systems. The resulting dipole gauge is a multi-orbital generalization of Peierls substitution. In this work, we investigate accuracy of both pathways, with particular emphasis on gauge invariance, for TB models constructed from maximally localized Wannier functions. Focusing on paradigmatic two-dimensional materials, we construct first-principle models and calculate the response to electromagnetic fields in linear response and for strong excitations. Benchmarks against fully converged first-principle calculations allow for ascertaining the accuracy of the TB models. We find that the dipole gauge provides a more accurate description than the velocity gauge in all cases. The main deficiency of the velocity gauge is an imperfect cancellation of paramagnetic and diamagnetic current. Formulating a corresponding sum rule however provides a way to explicitly enforce this cancellation. This procedure corrects the TB models in the velocity gauge, yielding excellent agreement with dipole gauge and thus gauge invariance.