Employing the relativized quark model and the quark-interchange model, we investigate the decay of the charged heavy quarkonium-like states $Z_c(3900)$, $Z_c(4020)$, $Z_c(4430)$, $Z_b(10610)$ and $Z_b(10650)$ into the ground and radially excited heavy quarkonia via emitting a pion meson. The $Z_c$ and $Z_b$ states are assumed to be hadronic molecules composed of open-flavor heavy mesons. The calculated decay ratios can be compared with the experimental data, which are useful in judging whether the molecule state assignment for the corresponding $Z_c$ or $Z_b$ state is reasonable or not. The theoretical framework constructed in this work will be helpful in revealing the underlying structures of some exotic hadrons.