Let $[X,Y]$ the set of homotopy classes of continuous maps between the topological spaces $X,Y$. Let us assume that both $X,Y$ are path connected. There is a canonical forgetful morphism, $$[(X,x_0);(Y,y_0)] \to [X,Y]$$ mapping homotopy classes of based maps (with homotopies respecting base points) to $[X,Y]$.
I am trying to show that this map is surjective. One idea that I had is to replace $X$ by the homotopy fiber (or fibrant replacement) $X_f$ which is equivalent to $X$ in order to have more flexibility. Then since $Y$ is path connected I have a path $\gamma$ joining $f(x_0)$ with $y_0$. Then if we look at the canonical map, $$ev_1:X_f \to Y,$$$$ (x,\gamma') \mapsto \gamma'(1)$$ one has that $ev_1(x_0,\gamma)=y_0$ which looks good. So maybe one could try to exhibit an homotopy equivalence between $(X,x_0) \sim (X_f;(x_0,\gamma))$ however I am not sure if this makes any sense or if I am just missing some obvious construction.