  Using the stratifications of Deligne-Mumford moduli spaces
$\overline{\mathcal M}_{g,n}$ indexed by stable graphs, we introduce a
partially ordered set of stable graphs by defining a partial ordering on the
set of connected stable graphs of genus $g$ with $n$ external edges. By
modifying the usual definition of zeta function and M\"obius function of a
poset, we introduce generalized ($\mathbb Q$-valued) zeta function and
generalized ($\mathbb Q$-valued) M\"obius function of the poset of stable
graphs. We use them to proved a generalized M\"obius inversion formula for
functions on the poset of stable graphs. Two applications related to duality in
earlier work are also presented.
