Let $R$ be a Noetherian ring, $I$ an ideal of $R$ and $M$ a ZD-module. Let $S$ be a Serre subcategory of the category of $R$-modules satisfying the condition $C_I$, and let $I$ contain a maximal $S$-sequence on $M$. We show that all maximal $S$-sequences on $M$ in $I$, have the same length. If this common length is denoted by $S\!\operatorname{-depth}(I,M)$, then $S\!\operatorname{-depth}(I,M)=\inf\{i:\Ext^i_R(R/I,M)\notin S\}=\inf\{i:H^i_I(M)\notin S\}$. Also some properties of this notion are investigated. It is proved that $S\!\operatorname{-depth}(I,M)=\inf\{\depth M_{\mathfrak p}:\mathfrak{p}\in V(I)\text{ and } R/\mathfrak{p}\notin S\} =\inf\{S\!\operatorname{-depth}(\mathfrak{p},M):\mathfrak{p}\in V(I) \text{ and } R/\mathfrak{p}\notin S\}$ whenever $S$ is a Serre subcategory closed under taking injective hulls, and $M$ is a ZD-module.