Localization commutes with quotient
Let us define a ring-homomorphism $u:R\to T$ by the universal property that a ring-homomorphism $f:R\to S$ factors (uniquely) through $u$ iff $f$ maps every element of $D$ to a unit and every element of $\mathfrak{a}$ to $0$. From the universal property of $D^{-1}R$, we see that any $f$ which factors through $u$ must factor through the localization map $i:R\to D^{-1}R$ via a unique map $g:D^{-1}R\to R$. Moreover, a map $f$ that factors through $i$ will factor through $u$ iff additionally $f(a)=g(i(a))=0$ for all $a\in \mathfrak{a}$. This happens iff $g$ maps all of $i(\mathfrak{a})$ to $0$. Equivalently, $g$ must factor through the quotient of $D^{-1}R$ by the ideal in $D^{-1}R$ generated by $i(\mathfrak{a})$, which is exactly $D^{-1}\mathfrak{a}$. This shows that maps factoring through $u$ are naturally in bijection with maps factoring through the composition $R\to D^{-1}R\to D^{-1}R/D^{-1}\mathfrak{a}$, so $T\cong D^{-1}R/D^{-1}\mathfrak{a}$.
On the other hand, we can do the same thing but in the reverse order to get that $T\cong \bar{D}^{-1}R/\mathfrak{a}$ as well. By the universal property of $R/\mathfrak{a}$, we see that if $f$ factors through $u$ then it factors through the quotient map $p:R\to R/\mathfrak{a}$ via a unique map $h:R/\mathfrak{a}\to S$. And a map $f$ which factors through $h$ will factor through $u$ iff additionally $f(d)=h(p(d))$ is a unit for all $d\in D$. This is equivalent to saying that $h$ factors through the localization of $R/\mathfrak{a}$ with respect to $p(D)=\bar{D}$. So $f$ factors though $u$ iff it factors through the composition $R\to R/\mathfrak{a}\to \bar{D}^{-1}R/\mathfrak{a}$.
I brute-forced this just for the fun of it, in a slightly different flavour than the above answer. First, the composition $R\to R/\mathfrak{a} \to \overline{D}^{-1}(R/\mathfrak{a})$ sends $D$ to invertible elements and so we get a map $\varphi: D^{-1}R\to \overline{D}^{-1}(R/\mathfrak{a})$ via $\frac{r}{d}\mapsto \frac{[r]}{[d]}$, where the brackets denote mod $\mathfrak{a}$. This map sends $D^{-1}\mathfrak{a}$ to $0$ and so we get a map
$$ \psi: \frac{D^{-1}R}{D^{-1}\mathfrak{a}} \rightarrow \overline{D}^{-1}\left(\frac{R}{\mathfrak{a}}\right) \hspace{.5cm} \text{via} \hspace{.5cm} \left[\frac{r}{d}\right] \mapsto \frac{[r]}{[d]}.$$
Similarly, the composition $R\to D^{-1}R\to \frac{D^{-1}R}{D^{-1}\mathfrak{a}}$ sends $\mathfrak{a}$ to $0$, and so we get a map $\theta: R/\mathfrak{a} \to \frac{D^{-1}R}{D^{-1}\mathfrak{a}}$ via $[r]\mapsto [r/1]$. This map sends $\overline{D}$ to units because $[d/1]\cdot [1/d]=[1/1]$, and so we get a map
$$ \eta: \overline{D}^{-1}\left(\frac{R}{\mathfrak{a}}\right) \rightarrow \frac{D^{-1}R}{D^{-1}\mathfrak{a}} \hspace{.5cm} \text{via} \hspace{.5cm} \frac{[r]}{[d]} \mapsto \left[\frac{r}{d}\right].$$
Thus $\psi$ and $\eta$ are inverses, QED.