We apply Schemes, Lemma \ref{schemes-lemma-points-specialize} to the specialization $x \leadsto x'$. This produces a morphism $\varphi : \Spec(B) \to X$ where $B$ is a valuation ring such that $\varphi$ maps the generic point to $x$ and the closed point to $x'$. We may also assume that $\kappa(x)$ is the fraction field of $B$. Let $A = B \cap \kappa(s)$. Note that this is a valuation ring (see Algebra, Lemma \ref{algebra-lemma-valuation-ring-cap-field}) which dominates the image of $\mathcal{O}_{S, s'} \to \kappa(s)$. Consider the commutative diagram $$ \xymatrix{ \Spec(B) \ar[rd] \ar[r] & X_A \ar[d] \ar[r] & X \ar[d] \\ & \Spec(A) \ar[r] & S } $$ The generic (resp.\ closed) point of $B$ maps to a point $x_A$ (resp.\ $x'_A$) of $X_A$ lying over the generic (resp.\ closed) point of $\Spec(A)$. Note that $x'_A$ is a closed point of the special fibre of $X_A$ by Morphisms, Lemma \ref{morphisms-lemma-base-change-closed-point-fibre-locally-finite-type}. Note that the generic fibre of $X_A \to \Spec(A)$ is isomorphic to $X_s$. Thus we have reduced the lemma to the case where $S$ is the spectrum of a valuation ring, $s = \eta \in S$ is the generic point, and $s' \in S$ is the closed point. \medskip\noindent We will prove the lemma by induction on $\dim_x(X_\eta)$. If $\dim_x(X_\eta) = 0$, then there are no other points of $X_\eta$ specializing to $x$ and $x$ is closed in its fibre, see Morphisms, Lemma \ref{morphisms-lemma-quasi-finite-at-point-characterize}, and the result holds. Assume $\dim_x(X_\eta) > 0$. \medskip\noindent Let $X' \subset X$ be the reduced induced scheme structure on the irreducible closed subscheme $\overline{\{x\}}$ of $X$, see Schemes, Definition \ref{schemes-definition-reduced-induced-scheme}. To prove the lemma we may replace $X$ by $X'$ as this only decreases $\dim_x(X_\eta)$. Hence we may also assume that $X$ is an integral scheme and that $x$ is its generic point. In addition, we may replace $X$ by an affine neighbourhood of $x'$. Thus we have $X = \Spec(B)$ where $A \subset B$ is a finite type extension of domains. Note that in this case $\dim_x(X_\eta) = \dim(X_\eta) = \dim(X_{s'})$, and that in fact $X_{s'}$ is equidimensional, see Algebra, Lemma \ref{algebra-lemma-finite-type-domain-over-valuation-ring-dim-fibres}. \medskip\noindent Let $W \subset X_\eta$ be a proper closed subset (this is the subset we want to ``avoid''). As $X_s$ is of finite type over a field we see that $W$ has finitely many irreducible components $W = W_1 \cup \ldots \cup W_n$. Let $\mathfrak q_j \subset B$, $j = 1, \ldots, r$ be the corresponding prime ideals. Let $\mathfrak q \subset B$ be the maximal ideal corresponding to the point $x'$. Let $\mathfrak p_1, \ldots, \mathfrak p_s \subset B$ be the minimal primes lying over $\mathfrak m_AB$. There are finitely many as these correspond to the irreducible components of the Noetherian scheme $X_{s'}$. Moreover, each of these irreducible components has dimension $> 0$ (see above) hence we see that $\mathfrak p_i \not = \mathfrak q$ for all $i$. Now, pick an element $g \in \mathfrak q$ such that $g \not \in \mathfrak q_j$ for all $j$ and $g \not \in \mathfrak p_i$ for all $i$, see Algebra, Lemma \ref{algebra-lemma-silly}. Denote $Z \subset X$ the locally principal closed subscheme defined by $g$. Let $Z_\eta = Z_{1, \eta} \cup \ldots \cup Z_{n, \eta}$, $n \geq 0$ be the decomposition of the generic fibre of $Z$ into irreducible components (finitely many as the generic fibre is Noetherian). Denote $Z_i \subset X$ the closure of $Z_{i, \eta}$. After replacing $X$ by a smaller affine neighbourhood we may assume that $x' \in Z_i$ for each $i = 1, \ldots, n$. By construction $Z \cap X_{s'}$ does not contain any irreducible component of $X_{s'}$. Hence by Lemma \ref{lemma-locally-principal-vertical} we conclude that $Z_\eta \not = \emptyset$! In other words $n \geq 1$. Letting $x_1 \in Z_1$ be the generic point we see that $x_1 \leadsto x'$ and $f(x_1) = \eta$. Also, by construction $Z_{1, \eta} \cap W_j \subset W_j$ is a proper closed subset. Hence every irreducible component of $Z_{1, \eta} \cap W_j$ has codimension $\geq 2$ in $X_\eta$ whereas $\text{codim}(Z_{1, \eta}, X_\eta) = 1$ by Algebra, Lemma \ref{algebra-lemma-minimal-over-1}. Thus $W \cap Z_{1, \eta}$ is a proper closed subset. At this point we see that the induction hypothesis applies to $Z_1 \to S$ and the specialization $x_1 \leadsto x'$. This produces a closed point $x_2$ of $Z_{1, \eta}$ not contained in $W$ which specializes to $x'$. Thus we obtain $x \leadsto x_2 \leadsto x'$, the point $x_2$ is closed in $X_\eta$, and $x_2 \not \in W$ as desired.