It's not exactly equivalent for dense set $A \subset X$ that:
"for any point $x \in X$, any neighborhood of $x$ contains at least one point from $A$"
$\iff$
"the only closed subset of $X$ containing $A$ is $X$"
Because doesn't the first one allow that $A$ can be larger than $X$ and that the complement of $X$ is some open non-empty set?
So in that case $X$ cannot equal $A$ and these two definitions for density are not equivalent?
Wikipedia writes them as being equivalent. https://en.wikipedia.org/wiki/Dense_set
The statements are equivalent. Let $A$ satisfy the upper condition and suppose $F$ is a closed set of $X$ such that $A \subseteq F$. If $F$ were not equal to $X$, consider the open set $O=X\setminus F$. Let $x \in O$. Then $x$ has a neighbourhood $O$ that does not contain a point of $A$. This contradicts the property we assumed of $A$. So $F = X$.
Conversely, suppose the only closed set containing $A$ is $X$: now let $x \in X$. If $x$ would have a neighbourhood not containing any points of $A$, then there would be an open set $O$ such that $x \in O$ and $ O \cap A = \emptyset$, or $A \subseteq X\setminus O$. But then $X\setminus O$ would be a closed set containing $A$ not equal to $X$, contrary to assumption. So no such $x$ can exist and the first property is shown.