Recall that group cohomology is not just about the trivial module, but is something you can compute for all $G$-modules. The corresponding thing on the topological side is to consider local systems on $K(G, 1)$ and their cohomology; in fact the category of local systems on $K(G, 1)$ is equivalent to the category of $G$-modules. Moreover, just as group cohomology is about taking derived invariants, cohomology of local systems is about taking derived global sections, and happily taking global sections of a local system is the same thing as taking invariants of the corresponding $G$-module. So there's reason to believe that the derived functors also match.
Now, as written this argument can't possibly work, because as it turns out the category of local systems on any reasonable path-connected space $X$ is equivalent to the category of $\pi_1(X)$-modules, but the cohomology of local systems on $X$ is sensitive to the higher homotopy of $X$ while the group cohomology of $\pi_1(X)$ is not. The difference in the case of general $X$ is that the resolutions needed to compute cohomology of local systems won't themselves be made of local systems; in the standard story these resolutions can be computed in the category of sheaves, but there's a much more interesting place to compute these resolutions, namely the (higher) category of derived local systems.
Roughly speaking, a derived local system on a space $X$ is an $\infty$-functor from the fundamental $\infty$-groupoid $\Pi_{\infty}(X)$ to, say, chain complexes. Unlike a local system, a derived local system is sensitive to the higher homotopy of $X$. Taking the derived global sections of such a thing (by which I mean taking the derived pushforward to a point, by which I mean some homotopy Kan extension) generalizes taking the cohomology of local systems, and in particular ordinary local systems on $X$ should possess resolutions in this category (in a suitable sense) allowing you to compute their cohomologies. If $X$ is a $K(G, 1)$ then this is just the category of chain complexes of $G$-modules and the familiar story from homological algebra takes over. (This generalizes the fact that to compute the cohomology of local systems on a $K(G, 1)$ it suffices to write down resolutions which are chain complexes of $G$-modules and it's unnecessary to consider more general sheaves.)