IMO-5g is not big enough for Danios, these guys needs lots of swimming space.....20g long would be a better fit along with at least 2 more to complete a small school.
Danios are a species that never stop moving or eating...lol.....and soon they could become stressed from swimming needs not being met and that in turn can cause health problems that can then cause health problems for the Betta.
IMO-5g is only big enough for 1 adult Betta with shrimp or snails as tank-mates.
I agree with OFL. Danios are a very energetic species that need more room to swim than a 5G can provide--absolute minimum would be a 10G. They also fare much better in higher numbers--in small groups they are likely to bully the betta and nip its fins.
A 5G is really only big enough for a betta and a few snails/shrimps. Any more is putting a bit too much strain on the bioload and is not taking into account the space that both species need to themselves.