No: if $X$ is non compact, it is a proper and dense subset, thus not closed, in its Stone–Čech compactification.
[edit] This is ok e.g. if X is $T_{3.5}$, as Bruno observes, otherwise $X\to\beta X$ may be surjective (I tend to culpably remove from my conscience the existence of less-separated topological spaces). So, given that a non-compact $T_{3.5}$ space is a proper subspace of its SC compactification, a suitable statement is "compact equals universally closed for $T_{3.5}$ spaces ", and analogous statements may be sought for other categories of topological spaces. In any case, it does not seem very fair, in the definition of "universally closed", to ask for more separation in $Y$ than in $X$ as you are doing. As in Jonas Meyer's answer: for instance, let's consider $X= \mathbb{Z} ,$ with left-unbounded order intervals as open sets. Then every two non-empty closed sets have non-empty intersection, so any continuous map $f:X\to Y$ to a Hausdorff space $Y$ is constant, thus $X$ is $T_0$, non-compact but universally closed in the definition you gave).