  The superconformal index $Z$ of the 6d (2,0) theory on $S^5 \times S^1$
(which is related to the localization partition function of 5d SYM on $S^5$)
should be captured at large $N$ by the quantum M2 brane theory in the dual
M-theory background. Generalizing the type IIA string theory limit of this
relation discussed in arXiv:2111.15493 and arXiv:2304.12340, we consider
semiclassically quantized M2 branes in a half-supersymmetric 11d background
which is a twisted product of thermal AdS$_7$ and $S^4$. We show that the
leading non-perturbative term at large $N$ is reproduced precisely by the
1-loop partition function of an "instanton" M2 brane wrapped on $S^1\times S^2$
with $S^2\subset S^4$. Similarly, the (2,0) theory analog of the BPS Wilson
loop expectation value is reproduced by the partition function of a "defect" M2
brane wrapped on thermal AdS$_3\subset$ AdS$_7$. We comment on a curious
analogy of these results with similar computations in arXiv:2303.15207 and
arXiv:2307.14112 of the partition function of quantum M2 branes in AdS$_4
\times S^7/\mathbb Z_k$ which reproduced the corresponding localization
expressions in the ABJM 3d gauge theory.
