If $V$ is a vector field on $M$, its lift to $T^*M$ is a Hamiltonian vector field with hamiltonian function $V$ (viewed as a linear function on the fibers). And if the vector field $V$ is $G$-invariant, it is also invariant as a function on $T^*M$ for the lifted action.
This has nothing to do with the fact that $V$ is a gradient.