It has to be annihilated by the sheaf of ideals of $Z$. If you are working with a noetherian scheme and a coherent sheaf at least, we can at least filter $\mathcal{F}$ by subsheaves $\mathcal{I}^i \mathcal{F}$ (where $\mathcal{I}$ is the sheaf of ideals of $Z$) whose successive quotients are $O_S$-modules. Here $\mathcal{I}^i \mathcal{F} = 0$ for $i$ large by the assumption on support in $Y$. Indeed, $Y$ can be defined as $V(\mathcal{a})$ for some ideal $\mathcal{a}$. Then $M_{\mathfrak{p}} = 0$ if $\mathfrak{p} \not \supset \mathcal{a}$. Therefore, every associated prime must contain $\mathcal{a}$, so there is a filtration $0=M_0 \subset M_1 \subset \dots \subset M_k = M$ whose quotients are isomorphic to the form $A/\mathfrak{p}$ where $\mathfrak{p} \supset \mathcal{a}$ is a prime, which means $M$ is annihilated by $\mathcal{a}^k$.