I think that generally putting bettas in with other labyrinth fish (anabantids) like gouramis isn't a great idea, but I"ve heard of it working. It really depends on the fish. I have a male betta in a 55 gallon with long and short finned zebra danios, gold barbs, platys, cories and loaches and he doesn't bother or pay attention really to anyone. It really depends on the fish. I don't really have any fish that have super long fins though, so that might help him out. The worst I've seen him do is flare at his own reflection. The other fish don't bother him. I would try the betta out, and keep a close eye on him. In a 5 gallon, as someone mentioned, they probably wouldn't be good with other fish, but in a tan kthe size of yours, he should have plenty of room
Before I got my 55 gallon, I had teh betta in a tank that was either 20 or 30 gallons with basically the same combination of fish (just fewer) without the loaches, and he was also no problem in there either.