Choose affine open neighbourhoods $\Spec(A)$ of $s$ and $\Spec(B)$ of $x$ such that $\varphi(\Spec(B)) \subset \Spec(A)$. Let $\mathfrak p \subset A$ be the prime ideal corresponding to $s$. Let $\mathfrak q \subset B$ be the prime ideal corresponding to $x$. Let $I \subset B$ be the ideal corresponding to $Z$. By the initial assumption of the lemma we know that $A \to B$ is flat and of finite presentation. The assumption in (1) means that, after shrinking $\Spec(B)$, we may assume $I(B \otimes_A \kappa(\mathfrak p))$ is generated by a single element which is a nonzerodivisor in $B \otimes_A \kappa(\mathfrak p)$. Say $f \in I$ maps to this generator. We claim that after inverting an element $g \in B$, $g \not \in \mathfrak q$ the closed subscheme $D = V(f) \subset \Spec(B_g)$ is a relative effective Cartier divisor. \medskip\noindent By Algebra, Lemma \ref{algebra-lemma-flat-finite-presentation-limit-flat} we can find a flat finite type ring map $A_0 \to B_0$ of Noetherian rings, an element $f_0 \in B_0$, a ring map $A_0 \to A$ and an isomorphism $A \otimes_{A_0} B_0 \cong B$. If $\mathfrak p_0 = A_0 \cap \mathfrak p$ then we see that $$ B \otimes_A \kappa(\mathfrak p) = \left(B_0 \otimes_{A_0} \kappa(\mathfrak p_0)\right) \otimes_{\kappa(\mathfrak p_0))} \kappa(\mathfrak p) $$ hence $f_0$ is a nonzerodivisor in $B_0 \otimes_{A_0} \kappa(\mathfrak p_0)$. By Algebra, Lemma \ref{algebra-lemma-grothendieck} we see that $f_0$ is a nonzerodivisor in $(B_0)_{\mathfrak q_0}$ where $\mathfrak q_0 = B_0 \cap \mathfrak q$ and that $(B_0/f_0B_0)_{\mathfrak q_0}$ is flat over $A_0$. Hence by Algebra, Lemma \ref{algebra-lemma-regular-sequence-in-neighbourhood} and Algebra, Theorem \ref{algebra-theorem-openness-flatness} there exists a $g_0 \in B_0$, $g_0 \not \in \mathfrak q_0$ such that $f_0$ is a nonzerodivisor in $(B_0)_{g_0}$ and such that $(B_0/f_0B_0)_{g_0}$ is flat over $A_0$. Hence we see that $D_0 = V(f_0) \subset \Spec((B_0)_{g_0})$ is a relative effective Cartier divisor. Since we know that this property is preserved under base change, see Lemma \ref{lemma-relative-Cartier}, we obtain the claim mentioned above with $g$ equal to the image of $g_0$ in $B$. \medskip\noindent At this point we have proved (1). To see (2) consider the closed immersion $Z \to D$. The surjective ring map $u : \mathcal{O}_{D, x} \to \mathcal{O}_{Z, x}$ is a map of flat local $\mathcal{O}_{S, s}$-algebras which are essentially of finite presentation, and which becomes an isomorphisms after dividing by $\mathfrak m_s$. Hence it is an isomorphism, see Algebra, Lemma \ref{algebra-lemma-mod-injective-general}. It follows that $Z \to D$ is an isomorphism in a neighbourhood of $x$, see Algebra, Lemma \ref{algebra-lemma-local-isomorphism}. To see (3), after possibly shrinking $U$ we may assume that the ideal of $D$ is generated by a single nonzerodivisor $f$ and the ideal of $Z$ is generated by an element $g$. Then $f = gh$. But $g|_{U_s}$ and $f|_{U_s}$ cut out the same effective Cartier divisor in a neighbourhood of $x$. Hence $h|_{X_s}$ is a unit in $\mathcal{O}_{X_s, x}$, hence $h$ is a unit in $\mathcal{O}_{X, x}$ hence $h$ is a unit in an open neighbourhood of $x$. I.e., $Z \cap U = D$ after shrinking $U$. \medskip\noindent The final statements of the lemma follow immediately from parts (2) and (3), combined with the fact that $Z \to S$ is locally of finite presentation if and only if $Z \to X$ is of finite presentation, see Morphisms, Lemmas \ref{morphisms-lemma-composition-finite-presentation} and \ref{morphisms-lemma-finite-presentation-permanence}.