Does this work?
Let $U\subset Z$ be the set of smooth points. This is open and dense in $Z$. Let $Z'\subset M$ be the smallest closed complex analytic variety containing $Z$. Let $U$$U'$ be the set of smooth points of $Z'$. I believe that $U=Z\cap U'$ is not only open but also closed in $U'$, by some form of the uniqueness of analytic continuation. SinceSo $U'\backslash U$ is open in $Z'$ and disjoint from $Z$, it. Can you argue that the closed set $Z'\backslash (U'\backslash U)$ is complex analytic and therefore must be empty. Soall of $Z$? If so, then $U=U'$ and therefore $Z=Z'$.