$\DeclareMathOperator\cl{cl}$I am interested under what assumptions one can always extend continuously a function defined on a dense subset; the range of the function is compact but not necessarily Hausdorff.

That is, I am interested in generalisations of the following theorem [Engelking, General Topology] to non-Hausdorff compact spaces:

3.2.1. THEOREM. Let $A$ be a dense subspace of a topological space $X$ and $f$ a continuous mapping of $A$ to a compact space $Y$. The mapping $f$ has a continuous extension over $X$ if and only if for every pair $B_1$, $B_2$ of disjoint closed subsets of $Y$ the inverse images $f^{-1}(B_1)$ and $f^{-1}(B_2)$ have disjoint closures in the space $X$.

I am mostly interested in sufficient conditions.

For example, is the following sufficient?

(i) For each $Z_1, Z_2\subset A$, it holds $\cl_X(Z_1) \cap \cl_X( Z_2) = \cl_X( \cl_A(Z_1)\cap \cl_A(Z_2))$.

(ii) For each $Z\subset X$ closed, and each pair of closed subsets $Z_1, Z_2\subset A$ such that $Z\cap A=Z_1\cup Z_2$, there are $Z'_1, Z'_2 \subset X$ closed such that $Z=Z'_1\cup Z'_2$, and $Z_1=Z'_1\cap A$, and $Z_2=Z'_2\cap A$, and $Z'_1\cap Z'_2=\cl_X(Z_1\cap Z_2)$.

(iii) $A$ is an open dense subset of $X$.