Let $Y$ be some smooth projective variety over $\mathbb C$ with $\dim Y \geq 2$. For a closed sub-variety $X \hookrightarrow Y$, consider the following property:

There is some small open neighborhood $U$ of $X$ inside $Y$ (in the complex topology), such that the only closed sub-variety $Z$ of $Y$ inside $U$ with $\dim Z=\dim X$ is just $X$ itself.

When does such $X$ exist (except trivial cases e.g $X=Y$)? Can we classify all such $X$ ? For simplicity, one can assume $X$ is a divisor and smooth.

Motivation: In Accumulation of algebraic subvarieties: Near one subvariety there are many others (?), 2, one finds an example given by $Y=Bl_O (\mathbb P^2)$ and $X$ being the exceptional divisor. In general, the divisors with such property seem to be quite special, and the existence depends on the intersection theory on $Y$.