Coincidence set closed equivalent to diagonal closed Prove

For any topological space $Y$ and any continuous maps $f, g : Y → X$, the set
  $\{y ∈ Y : f(y) = g(y)\}$ is closed in $Y$ 

is equivalent to 

The diagonal $∆ = \{(x, x) : x ∈ X\}$ is a closed subset of $X × X$, in the product
  topology.

I've proved that the diagonal being closed is equivalent to $X$ being Hausdorff, and also proved that the diagonal closed implies the coincidence set is closed but can't do the reverse implication, any hints? Have tried to show the complement is open, ie there  is an open neighbourhood about each point, but can't seem to find a useful way to use the coincidence set being closed. The functions $f, g$ seem to be mapping the 'wrong way' as it were, so not sure how their continuity can be used.

Consider $\pi_1:X_1$x$X_2 \rightarrow X_1$ and $\pi_2:X_1$x$X_2 \rightarrow X_2$ where $X_1 = X = X_2$, $\forall i \in \left\{1, 2\right\}$, $\pi_i$ is the natural projection, i.e. $\pi_i(x_1, x_2) = x_i$.
We know that $\pi_i$ is continue $\forall i \in \left\{1, 2\right\}$, and $\Delta(X)$ is the coincidence set of $\pi_1$ and $\pi_2$.
Now we use the hypothesis and we have the thesis.
