I know (see for example page 47 in Brown) that a short exact sequence of groups
$$1 \rightarrow N \rightarrow G \rightarrow Q \rightarrow 1$$
gives rise to a 5 term exact sequence in their homology groups
$$H_2(G) \rightarrow H_2(Q) \rightarrow H_1(N)_Q \rightarrow H_1(G) \rightarrow H_1(Q) \rightarrow 0$$
I also know that there is a 5 term exact sequence for cohomology groups but I can't find a source for it. My guess would be to reverse arrows and switch to invariants instead of co-invariants, so:
$$ 0 \leftarrow H^2(G) \leftarrow H^2(Q) \leftarrow H^1(N)^Q \leftarrow H^1(G) \leftarrow H^1(Q) $$
Is this correct? Have I confused coinvariants and invariants? Does anyone has a source that lays this out nicely?
The five term exact sequence in group cohomology is:
$$0 \to H^1(Q,M^N)\xrightarrow{\text{inf}}H^1(G,M) \xrightarrow{\text{res}}H^1(N,M)^Q \xrightarrow{\text{tg}}H^2(Q,M^N) \xrightarrow{\text{inf}}H^2(G,M).$$
For a reference see Huebschmann: Exact sequences in the cohomology of a group extension, J. of Algebra 444, 297-312 (2015). There can also be found further references.