First note that in K if $\vdash p\rightarrow q$, then $\vdash \lozenge p \rightarrow \lozenge q$. This is because if $\vdash p\rightarrow q$, then $\vdash \lnot q\rightarrow \lnot p$. By necessitation, $\vdash \square (\lnot q\rightarrow \lnot p)$. By K, $\vdash \square \lnot q \rightarrow \square \lnot p$. This is equivalent to $\vdash \lnot \lozenge q \rightarrow \lnot \lozenge p$, which is equivalent to $\vdash \lozenge p\rightarrow \lozenge q$.
The reason for this observation is that from 5, we also get $\vdash \lozenge\lozenge q \rightarrow \lozenge \square \lozenge q$.
Now to prove $\square p\rightarrow p$, it suffices to prove $q\rightarrow \lozenge q$, since substituting $\lnot p$ for $q$ gives the contrapositive of the statement you want to prove. So assume $q$.
By B, $\square \lozenge q$. By D, $\lozenge \lozenge q$. By the consequence of 5 noted above, $\lozenge \square \lozenge q$. And finally by the contrapositive of $B$ ($\lozenge \square p\rightarrow p$), we have $\lozenge q$, as desired.
Here's some motivation for where this argument comes from. Semantically, on Kripke frames, T corresponds to reflexivity, B corresponds to symmetry, D corresponds to the "serial" property (for every world, there is at least one world accessible from it), and 5 corresponds to the "Euclidean" property (if $w$ and $w'$ are both accessible from $v$, then $w'$ is accessible from $w$). So the claim that T follows from B, D, and 5 corresponds to the claim that every symmetric, serial, Euclidean frame is reflexive.
To argue this, pick a world $w$. By seriality, there is a world $w'$ accessible from $w$. By symmetry, $w$ is accessible from $w'$. By Euclideanity, since $w$ and $w$ are accessible from $w'$, $w$ is accessible from $w$. So we've proven reflexivity.
I used this semantic argument as a kind of informal guide to constructing the syntactic argument above. Think of $q$ as a property that holds at a world $w$. Then to show $\lozenge q$, we can show $w$ is accessible from itself. We use seriality (D) and symmetry (B) to "move" to another world $w'$ from which $w$ is accessible ($\lozenge\lozenge q$). Then we use Euclideanity at $w'$ ($\lozenge q \rightarrow \square \lozenge q$, but "inside the diamond", since we're applying the implication at $w'$, not at $w$). And then we see where we are ($\lozenge\square\lozenge q$) and figure out that we have to use symmetry again to "move" back to $w$. It's not a perfect analogy or a foolproof method, but this kind of strategy can be useful.