Let $(y_n)$ be a sequence in $Y$. Let $A$ be the subset of $Y \times \mathbf{R}$ of all points $(y_n, \frac{1}{n})$ for $n \in \mathbf{N}$, and let $B$ be its closure. Then $\pi_2[B]$ is closed in $\mathbf{R}$, and contains all points $\frac{1}{n}$, so it contains $0$. So for some $y \in Y$, $(y,0) \in B$. Using the countable base we can extract a subsequence of the $(y_n)$ that converges to $Y$ (as $Y$ is first countable in particular). [edit: problem here: I think I use We do then need that $T_1$ herey$ is in the closure of all subsequences of $(y_n)$ as well, which follows in a similar way, otherwise I we cannot guarantee get (without separation axioms) a convergent subsequence , so for $T_1$-spaces from first countability alone. But this seems to hold, not yet sure about the general case] works.
So $Y$ is sequentially compact, which implies that $Y$ is countably compact (in the covering sense; no separation axioms needed) and as $Y$ is also Lindelöf, being second countable, $Y$ is compact.

