We have performed a combined analysis of the BESIII data for both the $Z_c(3900)$ and $Z_{cs}(3985)$ structures, assuming that the latter is an SU(3) flavor partner of the former one. We have improved on the previous analysis of Albaladejo $et$ $al.$ [Phys. Lett. B 755, 337 (2016)] by computing the amplitude for the $D_1\bar{D}D^*$ triangle diagram considering both $D$ and $S$-wave $D_1D^*\pi$ couplings. We have also investigated effects from SU(3) light-flavor violations, which are found to be moderate and of the order of 20%. The successful reproduction of the BESIII spectra, in both the hidden-charm and hidden-charm strange sectors, strongly supports that the $Z_{cs}(3985)$ and $Z_c(3900)$ are SU(3) flavor partners placed in the same octet multiplet. The best results are obtained when an energy-dependent term in the diagonal $D^{(*)}\bar D_{(s)}^{(*)}$ interaction is included, leading to resonances (poles above the thresholds) to describe these exotic states. We have also made predictions for the isovector $Z_{c}^*$ and isodoublet $Z_{cs}^*$, $D^*\bar{D}^*$ and $D^*\bar{D}_{s}^*$ molecules, with $J^{PC}=1^{+-}$ and $J^{P}=1^{+}$, respectively. These states would be heavy-quark spin symmetry partners of the $Z_{c}$ and $Z_{cs}$. Besides the determination of the masses and widths of the $Z_c(3900)$ and $Z_{cs}(3985)$, we also predict those of the $Z_c^*$ and $Z_{cs}^*$ resonances.