Let $G=(V,E)$ be a directed acyclic graph, and let $A,B,Z\subset V$ be pairwise disjoint vertex sets. Let
\begin{align*}
W:=\operatorname{An}_G(A\cup B\cup Z)
\end{align*}
be the set of all vertices of $G$ that are ancestors of at least one vertex in $A\cup B\cup Z$, where each vertex is counted as its own ancestor. Let $G_W$ be the induced sub-DAG of $G$ on $W$, and let $H$ be the moral graph of $G_W$: thus $H$ is the undirected graph on vertex set $W$ in which two distinct vertices are adjacent if they are adjacent by a directed edge in $G_W$, or if they are both parents in $G_W$ of some common child in $G_W$.
In this statement, $Z$ d-separates $A$ and $B$ in $G$ means that there is no $Z$-active route in $G$ with one endpoint in $A$ and the other endpoint in $B$, where a route is a finite vertex sequence following directed edges without regard to orientation, non-endpoint colliders have both adjacent arrowheads pointing into the vertex, non-endpoint non-colliders must avoid $Z$, and non-endpoint colliders must have a directed descendant in $Z$.
Then $Z$ d-separates $A$ and $B$ in $G$ if and only if $Z$ separates $A$ and $B$ in $H$, meaning that every undirected path in $H$ with one endpoint in $A$ and the other endpoint in $B$ contains at least one vertex of $Z$.