  We study the effects of the introduction of a $\vartheta$ term in minimal
gauged supergravity in four dimensions. We show why this term is not present in
supergravity duals of field theories arising on wrapped $M2$-branes, but is
there in the case of $M5$-branes wrapping hyperbolic manifolds $\Sigma_3$, and
compute the higher-derivative corrections. Having proved that the on-shell
supergravity action of any supersymmetric solution can be expressed in terms of
data from the fixed points of a Killing vector, we show that it is proportional
to a complex topological invariant of $\Sigma_3$. This is consistent with the
characteristics of the dual three-dimensional $\mathcal{N}=2$ SCFT predicted by
the $3d$-$3d$ correspondence, and we match the large $N$ limit of its partition
functions in the known cases.
