Let $(X,A)$ be a CW-pair, $Y$ a CW-complex, and $f,g:X\to Y$ homotopic maps such that $f_{|A}=g_{|A}$. Even though $f$ and $g$ are homotopic, they do not have to be homotopic relative $A$. (Obstruction theory tells us how to deal with this issue.)
Let us further assume that $B\subseteq Y$ is a contractible subcomplex and that the compositions $X\stackrel{f}{\longrightarrow}Y\stackrel{pr}{\longrightarrow} Y/B$ and $X\stackrel{g}{\longrightarrow}Y\stackrel{pr}{\longrightarrow} Y/B$ are homotopic relative $A$.
I haven't thought about this for very long, but shouldn't this already imply that the original maps $f$ and $g$ are homotopic relative $A$?
(If this is true, then we can probably drop the assumption of $f$ and $g$ being (freely) homotopic.)
Sebastian