You can indeed! ByBy Yoneda, any natural way of getting cohomology classes can be realized on the Eilenberg-MacLane spaces. YouYou can look at those "freebie" classes in H^n(K(Z,n);G)$H^n(K(\mathbb{Z}, n); G)$ coming from the universal class in H^n(K(Z,n);Z)$H^n(K(\mathbb{Z}, n); \mathbb{Z})$, and this will give your desired map K(Z,n) \to K(G,n)$K(\mathbb{Z}, n) \to K(G, n)$. HoweverHowever, there's a nice bigger story behind this specific case besides just Yoneda.
First, the Dold-Kan theorem says that (nonnegatively graded) chain complexes of abelian groups are equivalent to simplicial abelian groups. MoreMore precisely, given a simplicial abelian group, the alternating sum of the face maps turns it into a chain complex, and modding out by the image of the degeneracies gives the "normalized" chain complex. This turns out the be an equivalence of categories (the inverse is taking a chain complex and formally adding degenerate things to it). What'sWhat's more, this equivalence preserves the usual notion of homotopy in the two categories: the derived category of abelian groups is the same as simplicial abelian groups with weak equivalences formally inverted.
Now K(G,n)$K(G, n)$ can be realized as the simplicial abelian group which corresponds to the chain complex with G$G$ in degree n$n$ and 0$0$ everywhere else. MapsMaps of simplicial abelian groups (mod homotopy) from K(G,n)$K(G, n)$ to K(H,m)$K(H, m)$ are then the same as maps of chain complexes in the derived category, i.e. Ext^{m-n}(G,H)$\operatorname{Ext}^{m-n}(G, H)$. ThisThis is 0$0$ except for m=n$m=n$ and m=n+1$m=n+1$, and in those cases you get exactly the correspondence that the universal coefficient theorem gives you. The cohomology operations with m=n+1 $m=n+1$ (coming from the Ext$\operatorname{Ext}$ part of the universal coefficient theorem) are called Bocksteins and can also be obtained as the connecting homomorphisms of a long exact sequence on cohomology coming from a short exact sequence of coefficient groups (namely, the group extension corresponding to your element of Ext$\operatorname{Ext}$).
Note that there are lots of other operations on cohomology (eg, Steenrod operations) besides these. WhatWhat makes these special is that they can be implemented by maps from K(G,n)$K(G, n)$ to K(H,m)$K(H, m)$ which are group homomorphisms with respect to the abelian group structures on the spaces. NoteNote, however, that any cohomology operation which commutes with addition (which includes all Steenrod operations) is a group homomorphism up to homotopy, since the group structure on cohomology is just the group structure on K(G,n)$K(G, n)$ taken modulo homotopy. NeverthelessNevertheless, it is impossible to straighten these out to be homomorphisms on the nose, except in the case of Bocksteins and in the case n=m$n=m$.