Without loss of generality, we may disregard conditioning on events of probability zero. Suppose first that $X \to Y \to Z$ is a Markov chain. Using result
R4812: Characterisation of a Markov chain triple by iterated conditioning, we have
\begin{equation}
\begin{split}
\mathbb{P}(X = x, Z = z \mid Y = y)
& = \frac{\mathbb{P}(X = x, Y = y, Z = z)}{\mathbb{P}(Y = y)} \\
& = \frac{\mathbb{P}(Z = z \mid Y = y) \mathbb{P}(Y = y \mid X = x) \mathbb{P}(X = x)}{\mathbb{P}(Y = y)} \\
& = \frac{\mathbb{P}(Y = y \mid X = x) \mathbb{P}(X = x)}{\mathbb{P}(Y = y)} \frac{\mathbb{P}(Z = z \mid Y = y) \mathbb{P}(Y = y)}{\mathbb{P}(Y = y)} \\
& = \frac{\mathbb{P}(X = x, Y = y)}{\mathbb{P}(Y = y)} \frac{\mathbb{P}(Z = z, Y = y)}{\mathbb{P}(Y = y)} \\
& = \mathbb{P}(X = x \mid Y = y) \mathbb{P}(Z = z \mid Y = y)
\end{split}
\end{equation}
The converse result follows by rearranging the above chain of equalities by gluing the endpoints together and splitting between the first and second inequalities. $\square$