Does homotopy equivalence of pairs $f:(X,A)\to(Y,B)$ induce the homotopy equivalence of pairs $f:(X,\bar A)\to(Y,\bar B)$?

I came across this post and have just solved this problem for a course I am taking, so I thought I'd post my solution; as you said, it pretty much boils down to interchanging limits via continuity:


If $a \in \overline{A}$, then $\exists~\{a_k\} \subset A$ s.t. $\lim\limits_{k \to \infty} a_k = a$. Then we have \begin{equation*} f(a) = f(\lim\limits_{k \to \infty} a_k) = \lim\limits_{k \to \infty} f(a_k) \in \overline{B} \end{equation*} where limits are interchanged due to continuity of $f$, and last statement is due to $f(a_k) \in B$ for all $k$. We now have $f(\overline{A}) \subset \overline{B}$. $f$ homotopy equivalence of pairs $\implies \exists~g:Y \to X$ and $F_t:X \to Y$ with. $F_0 = g \circ f, F_1 = \text{id}_X$ and $F_t(A) \subset A$ for all $t$. For $a \in \overline{A}$ as above, we have \begin{equation*} F_t(a) = F_t(\lim\limits_{k \to \infty } a_k) = \lim\limits_{k \to \infty } F_t(a_k) \in \overline{A} \end{equation*} Thus $F_t(\overline{A}) \subset \overline{A}$ for all $t$. This implies that $f:(X,\overline{A}) \to (Y,\overline{B})$ is a homotopy equivalence of pairs.


EDIT: This only works if the underlying space is metrizable.