This is an instance of the basic fact that possible denominators for a fraction are closed under gcd, i.e. $ $ if a fraction $\,q\,$ is writable with denom's $\,b_1$ and $\,b_2$ then it is writable with denom $\,\gcd(b_1,b_2).\,$
It's a $1$ line $\rm\color{#90f}{Proof}$ from your $\color{#c00}{\rm equality},\:\!$ via $\rm\color{#0a0}{DL}$ = gcd Distributive Law $\,x(y,z)\! =\! (xy,xz)$
$\!\begin{align} {\bf Your\ case}\!:\,\ \ &\ 0 < q\, =\, {\small \color{#c00}{\frac{a\!-\!c}{d\!+\!b}\ =\ \dfrac{d\!-\!b}{a\!+\!c}}} \Rightarrow\ q ={\small \dfrac{(a\!-\!c,d\!-\!b)}{(d\!+\!b,a\!+\!c)} = \frac{k}n,}\ \ \ \text{follows by}\\[.5em]
{\bf Lemma}\!:\qquad &\ 0\,<\, q\, =\, \color{#c00}{\dfrac{a_1}{b_1}\ =\ \dfrac{a_2}{b_2}}\ \ \Rightarrow\ q = \dfrac{(a_1,a_2)}{(b_1,b_2)},\ \ \ \ (x,y) :=\gcd(x,y)\\[.5em]
{\color{#90f}{\bf Pf\!\!:}}\,\ \ \color{#e80}{a_1}(b_1,b_2) &\!\overset{\rm\color{#0a0}{DL_{\phantom{'}\!}}}= (a_1 b_1, \color{#c00}{a_1 b_2}) = (a_1 b_1,\color{#c00}{a_2 b_1}) \overset{\rm\color{#0a0}{DL_{\phantom{'}\!}}}= \color{#e80}{b_1} (a_1,a_2)\,\Rightarrow\, \color{#e80}{\dfrac{a_1}{b_1}}=\dfrac{(a_1,a_2)}{(b_1,b_2)}\\[.6em]
{\bf Example}\!:\qquad\!\!\! &\ \qquad\ q = \dfrac{133}{247} = \dfrac{119}{221}\, \Rightarrow\ q = \dfrac{(133,119)}{(247,221)} = \dfrac{7}{13}\end{align}\qquad$
Remark $ $ Though - as usual - we can also give a proof of the Lemma via prime factorizations, the above proof has the advantage that it generalizes more widely since it requires much less - only a distributive law. Namely, if we eliminate use of fractions then the Lemma amounts to
$$a_1b_2 = b_1 a_2\ \Rightarrow\ a_1(b_1,b_2) = b_1(a_1,a_2)\qquad$$
This inference proof works for many other algebraic systems enjoying distributivity, e.g. we can read $\:\!(x,y)\:\!$ as an ideal instead of a gcd and it remains true. More simply, we can read $\:\!(x,y)\:\!$ as $\,x+y\,$ and then the proof shows that the mediant has the same value as two equal fractions, i.e.
$$q\, =\, \color{c00}{\dfrac{a_1}{b_1}\ =\ \dfrac{a_2}{b_2}}\ \Rightarrow\ q = \dfrac{a_1+a_2}{b_1+b_2}\qquad\qquad\qquad\qquad\!\!$$
and similarly for the (multi-)linear form $\,(x,y):= jx+ky$.
The lemma is viewable as a Euclidean descent on equivalent fractions - which often proves handy, e.g. it can be used to efficiently implement the extended Euclidean algorithm in (modular) fraction form, e.g. see here and here.
As explained here, we can also view the Lemma in "order" language, since the least denom of a fraction is its order in $\,\Bbb Q/\Bbb Z.\,$ Then said denominator descent is: $ $ if $\,m,n\,$ are denom's of $\,q\,$ then so too is their gcd $\:\!(n,m),\:\!$ which is an additive analog of the following well-known theorem
$${\rm if}\ \ q^m\! = 1 = q^n\ \ {\rm then}\ \ q^{(m,n)}=1,\ \ {\rm by}\ \ {\rm ord}(q)\mid m,n\,\Rightarrow\, {\rm ord}(q)\mid (m,n)\qquad$$
These ideas are abstracted when studying
pertinent algebraic structures: $ $ ideals and modules (viz. order ideals and denominator ideals), or annihilator ideals (in PIDs).