Let $f : X \to Y$ and $g : X \to Z$ each be a D18: Map.
Then $f$ constancy-preserving with respect to $g : X \to Z$ if and only if
\begin{equation}
\forall \, x, y \in X
\left( g(x) = g(y) \quad \implies \quad f(x) = f(y) \right)
\end{equation}