Suppose I have a compact $G$-space $M$, and a differential form $\omega$ on $M$ with the property that $$ \forall g\in G\quad g\omega = \omega + d\lambda_g, \quad(*) $$ i.e. $g\omega$ is cohomologous to $\omega$. If $G$ is compact, I can write something along the lines of $$ \omega=\langle g\omega\rangle_G-d\langle \lambda_g\rangle_G, \quad(\star) $$ where $\langle \cdot \rangle_G$ is average over $G$, to conclude that $\omega$ is cohomologous to the invariant form $\langle g\omega\rangle_G$. Analogous argumets show that de Rham cohomology of $M$ can be computed by invariant forms (one can show that if $\omega$ is closed, it satisfies $(*)$).
Now, my question is, what can be said in case of non-compact $G$? Is there an algebraic requirement I can impose on $G$ so that $(*)$ will imply $(\star)$? More generally (and perhaps more interestingly), are there situations beyond compact setup when I can characterize solutions to $(*)$?