If(Edited per request to add more detail.)
Consider first the case $G$$G = U(n)$. If $S^1 \to U(1)^n \subset U(n)$ is compact Hausdorffinjective, then bywith $H^*(BS^1) = Z[t]$, $H^*(BU(1)^n) = Z[t_1, \dots, t_n]$, $H^*(BU(n)) = Z[c_1, \dots, c_n]$, each $c_i$ mapping to the Peter–Weyl theorem there is a homomorphism $G \to K$$i$-th elementary symmetric polynomial in the $t_j$, and each $t_j$ mapping to $x_j t$ for some integers $x_j$, then some $c_i$ must map to a nonzero multiple of $t^i$, because otherwise each elementary symmetric polynomial in the $x_j$ would be zero, so that $\prod_{j=1}^n (x-x_j) = x^n$ and each $x_j = 0$, contradicting that $S^1 \to U(1)^n$ is (split) injective.
The same calculation works for $G = GL_n(C)$, since $U(n) \simeq GL_n(C)$.
For any compact LieHausdorff group $K$, such$G$ the Peter--Weyl theorem gives a homomorphism $\rho \colon G \to GL_n(C)$ that is injective on the given subgroup $S^1 \subset G$ has nontrivial image in $K$. Then By the calculation above, $\smash{\tilde H}^*(BK; \mathbb{Q}) \to \smash{\tilde H}^*(B{S^1}; \mathbb{Q})$ has nontrivial image$H^*(BGL_n(C)) \to H^*(BG) \to H^*(BS^1)$ maps some $c_i$ nontrivially, and factors throughso the middle algebra cannot be trivial.
You may equally well use $\smash{\tilde H}^*(BG; \mathbb{Q})$$Q$-coefficients everywhere.