For schooling or shoaling species I'd get 6 & keep very up on testing to get the hang of how often water changes would be needed to keep tank parameters stable. Some dwarf corys are very bottom centric (habrosus); others like pygmaus are almost mid-water swimmers most of the time. I have to say I've never had a tank as small as 5g, 10g is my smallest ever.
As a loach lover I have to say 6 rosy loaches might be awesome instead of corys but they're kinda shy...but oh so pretty bottom fish! I loved mine in a 20g long but gave them away recently so I can try co2 without endangering fish.