The statement holds in general if f:XtoS is a morphism of locally ringed spaces. The fibred product of locally ringed spaces can be constructed explicitly without gluing constructions, and also restricts to the fibred product of schemes. See this article (german; shall I translate it?) for details. I will make use of the explicit description given there. Also I use stalks all over the place. Probably this is not the most elegant proof, but it works.
First we construct a homomorphism mathcalOXotimesf−1mathcalOSmathcalOXtoDelta−1mathcalOXtimesSX. For that we compute the stalks at some point xinX lying over sinS:
(mathcalOXotimesf−1mathcalOSmathcalOX)x=mathcalOX,xotimesmathcalOS,smathcalOX,x,
(Delta−1mathcalOXtimesSX)x=mathcalOXtimesSX,Delta(x)=(mathcalOX,xotimesmathcalOS,smathcalOX,x)mathfrakq,
where mathfrakq is the kernel of the canonical homomorphism
mathcalOX,xotimesmathcalOS,smathcalOX,xtokappa(x),aotimesbmapstooverlineab.
Thus we get, at least, homomorphisms between the stalks (namely localizations). In order to get sheaf homomorphisms out of them, the following easy lemma is useful:
(*) Let F,G be sheaves on a topological space X and for every xinX let sx:FxtoGx be a homomorphism. Suppose that they fit together in the sense that for every open U, every section finF(U) and every xinU there is some open neighborhood xinWsubseteqU and some section ginG(W) such that sy maps fy to gy for all yinW. Then there is a sheaf homomorphism s:FtoG inducing s.
This can be applied in the above situation: Every section in a neighborhood of x in mathcalOXotimesf−1mathcalOSmathcalOX induced by an element in mathcalOX(U)otimesmathcalOS(V)mathcalOX(U) for some neighborhoods U of x and V of s such that Usubseteqf−1(V). This yields a section in mathcalOXtimesSX on the basic-open subset Omega(U,U,V;1)=UtimesVU and thus a section of Delta−1mathcalOXtimesSX on U. It is easily seen, that this construction yields the natural map on the stalks.
Thus we have a homomorphism alpha:mathcalOXotimesf−1mathcalOSmathcalOXtoDelta−1mathcalOXtimesSX. Now let J be the kernel of the multiplication map mathcalOXotimesf−1mathcalOSmathcalOXtomathcalOX and I be the kernel of the homomorphism Delta^# : Delta^{-1} mathcal{O}_{X times_S X} to mathcal{O}_X. Then for every ngeq1 our alpha restricts to a homomorphism
(mathcalOXotimesf−1mathcalOSmathcalOX)/Jnto(Delta−1mathcalOXtimesSX)/In,
which is given at xinX by the natural map
(mathcalOX,xotimesmathcalOS,smathcalOX,x)/mathfrakpnto((mathcalOX,xotimesmathcalOS,smathcalOX,x)/mathfrakpn)mathfrakq,
where mathfrakpsubseteqmathfrakq is the kernel of the multiplication map mathcalOX,xotimesmathcalOS,smathcalOX,xtomathcalOX,x.
We want to show that this map is an isomorphism, i.e. that the localization at mathfrakq is not needed. For that it is enough to show that every element in mathcalOX,xotimesmathcalOS,smathcalOX,x, whose image in mathcalOX,x is invertible, is invertible modulo mathfrakpn. Or in other words: Preimages of units are units with respect to the projection
(mathcalOX,xotimesmathcalOS,smathcalOX,x)/mathfrakpnto(mathcalOX,xotimesmathcalOS,smathcalOX,x)/mathfrakp1congmathcalOX,x.
However, this follows from the observation that the kernel mathfrakp1/mathfrakpn is nilpotent; cf. also this question.
I'm sure that there is also a proof which avoids stalks at all.
EDIT: So here is a direct construction of the homomorphism mathcalOXotimesf−1mathcalOSmathcalOXtoDelta−1mathcalOXtimesSX:
Let p1,p2 be the projections XtimesSXtoX. Then we have for i=1,2 the homomorphism
mathcalOXtopi∗mathcalOXtimesSXtopi∗Delta∗Delta−1mathcalOXtimesSX=(piDelta)∗Delta−1mathcalOXtimesSX=Delta−1mathcalOXtimesSX,
and they commute over f−1mathcalOS. Thus we get the desired homomorphism. But I think stalks are convenient when we want to show that this is an isomorphism when modding out the ideals.