Reducing to the affine case, the question is this:
Given a ring homomorphism $R\rightarrow S$, and given an ideal $I\subset R$, suppose that all of the following are isomorphisms: $$R/I\rightarrow S/IS$$ $$R_f\rightarrow S_f\quad \hbox{for any $f\in I$}$$ Can we conclude that $R\rightarrow S$ is an isomorphism?
Assuming irreducibility (i.e. assuming $R$ and $S$ are domains) the answer is certainly yes if $I=(f)$ is principal. Then it's easy to see that $R\rightarrow S$ is injective (because the injection $R\rightarrow R_f\approx S_f$ factors through it). For surjectivity, let $s\in S$. Then because $R_f\approx S_f$, we can write $f^ks=r$ for some $r\in R$. Then $r$ maps to zero in $S/fS$, so $r\in fR$, so (because $f$ is not a zero-divisor) $f^{k-1}s\in R$, contradicting the fact that we could have chosen $k$ minimal.
More generally, if $I=(f_1,\ldots,f_k)$ is finitely generated, then $f_i^N s\in R$ and therefore $f_i^N s\in I\subset R$ for every $i$, which at the very least forces $s$ to be integral over $R$.
I expect you can settle the general case either by generalizing this argument or by constructing $I$ and $S$ in a way that forces it to go wrong.