The usage of Nullstellensatz-like results should be more subtle here. A similar idea was discussed in a recent question: A version of Hilbert's Nullstellensatz for real zeros. A solution based on this for the case where $f:\Bbb{C}^n\rightarrow\Bbb{C}$ is a polynomial: The real polynomial $Q(x_1,\dots,x_n)=x_1^2+\dots+x_n^2-1$ is irreducible when $n\geq 2$ (nothing to prove when $n=1$). Its zero-locus in $\Bbb{R}^n$ is a submanifold of dimension $n-1$. Any polynomial $f\in\Bbb{C}[z_1,\dots,z_n]$ that vanishes on the real zero locus must be divisible by $Q$. (this is the content ofThis follows from the question I linked): writing $f$ as $P_1+{\rm{i}}P_2$ with $P_1$ and $P_2$ real polynomials, the fact therein must be applied twice to both $P_1$ and $P_2$.) In particular, $f$ is zero on the locus $\{(z_1,\dots,z_n)\in\Bbb{C}^n\mid z_1^2+\dots+z_n^2-1=0\}$.
Solution for a general analytic function) Consider a branch $\phi=\phi(z_1,\dots,z_{n-1})$ of $\sqrt{1-z_1^2-\dots-z_{n-1}^2}$ defined in a vicinity of a point $(a_1,\dots,a_{n-1})\in\Bbb{R}^{n-1}$ where $a_1^2+\dots+a_{n-1}^2\in [0,1)$. This is a holomorphic function defined on a complex ball $$ B:=\left\{(z_1,\dots,z_{n-1})\in\Bbb{C}^{n-1}\mid \sum_{k=1}^{n-1}|z_k-a_k|^2<r^2\right\} $$ of radius $r>0$ centered at the real point of $\Bbb{R}^{n-1}$. As $(z_1,\dots,z_{n-1})$ varies in $B$ (resp. in $B\cap\Bbb{R}^{n-1}$), $(z_1,\dots,z_{n-1},\phi(z_1,\dots,z_{n-1}))$ parametrizes an open subset of the complex sphere $\{(z_1,\dots,z_n)\in\Bbb{C}^n\mid z_1^2+\dots+z_n^2-1=0\}$ (resp. of the real sphere $\{(z_1,\dots,z_n)\in\Bbb{C}^n\mid z_1^2+\dots+z_n^2-1=0\}\cap\Bbb{R}^n$). Now $(z_1,\dots,z_{n-1})\mapsto f(z_1,\dots,z_{n-1},\phi(z_1,\dots,z_{n-1}))$ is a holomorphic function defined on the ball $B$ which vanishes on real slice $B\cap\Bbb{R}^{n-1}$ due to the assumption on $f$. This implies that all coefficients of its Taylor expansion at the center $(a_1,\dots,a_{n-1})\in\Bbb{R}^{n-1}$ of $B$ are zero. In particular, the function is identically zero on $B$. Consequently, the holomorphic function $f$ vanishes on an open subset of the complex sphere $\{(z_1,\dots,z_n)\in\Bbb{C}^n\mid z_1^2+\dots+z_n^2-1=0\}$. It is thus identically zero on whole complex sphere.