I am trying to find another proof of the following theorem
Theorem Let $X$ and $Y$ be two compact surfaces of genus greater than $2$. Then every homomorphism $π_1(X,x_0)→π_1(Y,y_0)$ is induced by a map $(X,x_0)→(Y,y_0)$ that is unique up to homotopy fixing $x_0$ .
In fact a general case of this is proved in Hatcher's Algebraic Topology (Proposition 1B.9. page 90). He uses CW-complexes and $K(G,n)$ spaces to prove this theorem.
Is there any other way to prove this theorem (without CW-complexes and $K(G,n)$ spaces)?