I will tell you my dwarf gourami experience and maybe it will help. I had one in a 10-
gal and he seemed fine, except that there could be no other fish in there with him, as he would harrass them endlessly, and they would hide (cardinal tetras in one case- moved to the 55 where they cavorted gaily with the angels- white clouds in another case, again moved to the 55). He was perfectly happy in there by himself, it seemed, but when I moved HIM to the 55 with the angels and everyone else he was perfectly fine, and happily lives there to this day (see my gallery, he swims with the angel now). He does not bother any of the small fish in there at all.
I have another DG in a 15-
gal and he actually killed all of his tankmates except corys (head/tail light tetras, lemon tetras). He is still in there with 3 corys and 2 giant mystery snails.
If you just want to keep the one fish then a 10
gal would be fine (I think 5 gals is too small for anything but maybe Endler's livebearer's or a single male betta). I love them for their color and personalities. Great bubble nest builders.