As far as I understand, the Nielsen-Ninomiya theorem states that (under mild conditions) the number of left and right-handed chiral fermions must be equal on the lattice, while the chiral gauge anomaly is the statement that the $U(1)$ gauge symmetry is violated if the number of left and right-handed chiral fermions are not equal (in the continuum).
Is it correct to say that the Nielsen-Ninomiya is equivalent to (a lattice version of) ensuring the chiral gauge anomaly vanishes? Or are there subtleties in moving from the lattice to the continuum?