  We use Cramer's formula for the inverse of a matrix and a combinatorial
expression for the determinant in terms of paths of an associated digraph
(which can be traced back to Coates) to give a combinatorial interpretation of
M\"obius inversion whenever it exists. Every M\"obius coefficient is a quotient
of two sums, each indexed by certain collections of paths in the digraph. Our
result contains, as particular cases, previous theorems by Hall (for posets)
and Leinster (for skeletal categories whose idempotents are identities). A
byproduct is a novel expression for the magnitude of a metric space as sum over
self-avoiding paths with finitely many terms. By means of Berg's formula, our
main constructions can be extended to Moore-Penrose pseudoinverses, yielding an
analogous combinatorial interpretation of M\"obius pseudoinversion and,
consequently, of the magnitude of an arbitrary finite category.
