Obviously, in a derivation, when we apply a _rule_ , this rule must use (one or more) formulas already present in the derivation.
Thus, if we refer to lines in the derivation by numbers, the simple rule must be:
> in line $n$ apply _Rule X_ to formulas in lines $i$ and $j$, with $i,j < n$.
With Modus tollens we can refer either to a _rule_ :
> $P\to Q,\lnot Q\vdash \lnot P$,
or to a _tautology_ :
> $((P\to Q)\land \
eg Q)\to \
eg P$.
In the first case, your line 5 is fine: it follows from lines 3) and 4) by _MT_.
In the second case, to be "formal", we have to interpose some intermediate steps :
> 4') $((B \lor D) \to E)\land \
eg E$ --- from 3) and 4) by Conjunction
>
> 4'') $[((B \lor D) \to E)\land \
eg E] \to \
eg ((B \lor D) \to E)$ --- tautology : _Modus Tollens_
to get :
> > 5) $\
eg (B \lor D) \to E$ --- from 4') and 4'') by _Modus ponens_.