Pygmy Cories don't show themselves that much unless they feel safe (dim lighting) and are in a shoal. The bigger the number the safer they feel, they can live in a 10g fine, you could plop 10 of them in. They'll hide for a few days but after awhile they'll show themselves, your Betta will stop trying to chase them after he finds them to be fast swimmers.
As for the 5g you could do 6 but that's pushing it, maybe you could have a shrimp farm in there? I always wanted one.