Both of these fish are in the labyrinth family and will fight for territory. Depending on what type of gourami and how big your betta is, a five gallon wouldn't be big enough for these two fish anyway, IMO.
I have safely kept a pearl gourami and a female betta in a 29 gallon tank with no aggression issues. If you just want to keep these two fish together, I would suggest a much larger tank, 20 or 30 gallon, along with some smaller 'interference' fish such as endlers or smaller tetras and lots of places to hide or get out of sight.