Let $(X,x), (Y,y), (Z,z)$ be germs of complex spaces and let $f\colon(X,x)\to (Z,z), g\colon (Y,y)\to (Z,z)$ be morphisms of germs of complex spaces.
Suppose there exists a map $h\colon(X,x)\to (Y,y)$ such that $g\circ h=f$. Can we conclude that $h$ is automatically a morphism of germs of complex spaces?
If not in general, what additional conditions on $g$ or on the spaces involved would guarantee that $h$ is a morphism?