Another generalization of the theorem for vector spaces could be the following.
Assume that $X \subset Y$ is a closed subvariety, with $Y$ connected. If
$\dim X = \dim Y $ and
$\textrm{mult}_xX = \textrm{mult}_x Y$ for all $x \in X$,
then $X=Y$.
In fact, assume $X \neq Y$. Since $Y$ is connected there exists $x \in X \cap \overline{Y \setminus X}$, and for such a $x$ we have
$\textrm{mult}_xY \geq \textrm{mult}_xX + \textrm{mult}_x \overline{Y \setminus X} \geq \textrm{mult}_xX+1$,
contradiction. This can be useful, since it does not require the irreducibility of $X$ and $Y$. However, the assumption about the connectedness of $Y$ cannot be dropped: consider the case where $Y$ is the disjoint union of two copies of $X$.
EDITED
EDIT. In a first version of this answer I required the condition $\dim T_xX = \dim T_xY$ instead of $\textrm{mult}_xX = \textrm{mult}_x Y$. This actually did not work, see damiano's comment below.

