Let say $\mathcal{F}$ is a locally free sheaf of abelian groups over $X$, where $X$ is an algebraic variety over $\mathbb{C}$ (or a field $k$) with analytic (or étale) topology and $Z$ is a closed subvariety of $X$ of codimension $d$. I want to ask if there exists, or under which condition there exists, an isomorphism $$H^{2d}_{Z}(X, \mathcal{F}) \xrightarrow{\sim} H^0(Z,\mathcal{F}).$$$$H^{2d}_{Z}(X, \mathcal{F}) \xrightarrow{\sim} H^0(Z,\mathcal{F}_{|Z}).$$ More specifically, can one deduce such an isomorphism from a suitable spectral sequence?