TITLE: Uniqueness theorem for conformal mapping
QUESTION [8 upvotes]: Let $f$ and $g$ be analytic functions in the unit disk $D$, continuous in the closed disk and locally univalent, $f'(z)\neq 0,\; g'(z)\neq 0,\; z\in D$.
Assume that each has only finitely many singularities on $\partial D$, so that
the images of $\partial D$ are piecewise analytic.
Suppose that there exists a homeomorphism $\phi:\partial D\to\partial D$ such that
$f(z)=g\circ\phi(z),\; z\in \partial D$. (This means that the images of the boundary under both functions are reparametrizations of the curve). Can we conclude from this that $\phi$ extends to a conformal automorphism of $D$?
Same question about meromorphic locally univalent functions.
Motivation: this is so, if $f$ and $g$ are globally univalent (injective). Indeed then they map the unit disk on plane regions with the same boundaries, so the images coincide.
EDIT. This is related to my other question:
Greatest lower bound for subordination
and using Milnor's counterexample mentioned in Misha's answer, one can construct a counterexample to the other question.

REPLY [8 votes]: This is a form of the following topological question: Does the boundary value uniquely determine an immersion of the closed disk into the plane, up to precomposition with a diffeomorphism of the disk. The answer is negative
and is due to John Milnor, see Poenaru's paper "Extension des immersions en codimension 1." Séminaire Bourbaki, 10 (1966-1968), Exp. No. 342.
Incidentally, the best results about classification of extensions of immersions $S^1\to R^2$ to immersions $D^2\to R^2$ are (still) due to S.Blank, his 1967 PhD thesis. These results are discussed in detail in Poenaru's paper.