Suppose that for a map $f: (D^n, S^{n-1}) \to (X,A)$ (where $(X,A)$ is an arbitrary pair of spaces) there exists a homotopy $H: D^n \times I \to X$ with $H(\_,0)=f$, $H(s,t) \in A$ for $s \in S^{n-1}$ and $t \in I$ and $H(\_,1)=g$ where $g: D^n \to A$.
Why can we always choose this homotopy relative to $S^{n-1}$?
I was able to show that $f \simeq h$, where $h : D^n \to A$ and $f|_{S^{n-1}} = h|_{S^{n-1}}$, but not with a homotopy relative to $S^{n-1}$.
I will show you that whevener you have chosen a homotopy $H$, you can construct a new homotopy which is constant on $S^{n-1}$.
First, we label points on $D^n$ as $(r,\theta)$, treating $r$ as a continuous function $D^n\rightarrow I$. If $s\in I$ and $x=(r,\theta)\in D^n$, we interpret the product $sx$ as $(sr,\theta)$. We also define the retraction $p:D^n\setminus 0\rightarrow S^{n-1}$ as sending $(r,\theta)$ to $(1,\theta)$.
Now define the homotopy $H_1:D^n\times I \rightarrow X$ as
$H_1(x,t) = H(\frac{2}{2-t}x,t)$ if $r\leq 1-t/2$
and
$H_1(x,t) = H(p(x),2-2r)$ if $r\geq 1-t/2$
Notice that these agree when $r=1-t/2$, so we can glue them together. Notice that $H_1(x,0)=f$, $H_1(x,1)\in A$ for all $x\in D^n$ and $H_1$ is constant on $S^{n-1}$.
There exists a homotopy between $H$ and $H_1$ relative to $D^n\times\{0\}$, i.e. fixing $f$, but I am unable to write it down now.