First let me address if $\mathcal Z$ is compact abelian, but not necessarily connected.
Let $\mathcal Z^0$ be the identity component. Then $\mathcal Z^0$ is a torus and $S^1 \subset \mathcal Z^0$ splits as a direct factor (its cocharacter is primitive). Further the component group of an abelian Lie group splits off, so $\mathcal Z \cong \mathcal Z^0 \times \mathcal Z/\mathcal Z^0$. Thus $\mathcal Z = S^1 \times \mathcal Z'$ for some $\mathcal Z'$.
Now let $G$ be as in the question. Let $\mathfrak g$ be the Lie algebra of $G$. By Levi decomposition $\mathfrak g = \mathfrak z \oplus \mathfrak k$ where $\mathfrak z$ is the center of $\mathfrak g$ and $\mathfrak k$ is (real) semisimple. Then $\mathfrak k$ is the Lie algebra of a simply connected compact group $\tilde K$. By Lie's third theorem $\mathfrak k \to \mathfrak g$ lifts to $\tilde K \to G$. If $\mathcal Z$ is the center of $G$, then the multiplication $\mathcal Z \times \tilde K \to G$ is a homomorphism of compact groups which is an isomorphism on tangent spaces, hence an isogeny. Let $K$ be the image of $\tilde K$. Write as above $\mathcal Z = S^1 \times \mathcal Z'$, and define $H = \mathcal Z'K \subset G$. Again $S^1 \times H \to G$ is an isogeny with kernel $Z \subset S^1 \cap H \subset \mathcal Z$.