The existence of such a biholomorphism is rather rare. For example, as a simple exercise you can check that already for a conic in $\mathbb CP^2$ such a biholomorphism does not exist. At the same time, in the case $M$ is exceptional in $X$, for example, $X$ is obtained by a blow up from $X'$ at a point $x'\in X'$ and $M$ is the exceptional divisor, then indeed the situation is the one you want.