Definition : A topological space is said to be countably compact if every countable open cover of the space admits a finite subcover.
The Proof of the Theorem stated in the title uses the first countability condition to a great extend. I need a counter example as to see that if the condition is dropped the theorem fails to hold.
I'll give two examples: let $Y=\omega_1+1$, the successor of the first uncountable ordinal in the order topology (I believe Munkres denotes it $\overline{W}$ or some such notation). Then $Y$ is not first countable and $X=\omega_1$ (or $W$) is a countably compact subset of $Y$ that is dense, not closed.
Let $Y=\{0,1\}^\mathbb{R}$ (compact and Hausdorff, not first countable at any point) and the $\Sigma$-product $$X=\{f\in \{0,1\}^\mathbb{R}: f^{-1}[\{1\}] \text{ at most countable }\}$$ is a countably compact subset of $Y$ that is again dense and not closed.