start by gradually putting 3/4th tablespoon of aquarium salt in that gallon tank. Maybe 1/2 tablespoon of "ice cream maker salt" or clean salt for the sidewalk.
Table salt runs smoothly because of silicates included as an additive. Those can coat gills and hamper breathing.
I have been using (it seems like forever) a 50 lb bag of cattle feed salt (sun dried ocean salt) for medication and brine shrimp. A friend picked it up at a farm supply store for a couple of bucks.
If the water is fresher than in the previous tank, that will be beneficial too. GG's axium about keeping the water as clean as possible and preventing most diseases applies.
Bailey and Burgess' Tropical Fishlopaedia would suggest Hypoxia (not enough oxygen in the water). poisoning in the water, or a swim bladder infection, among other things. See if frequent small water changes (10-20% a day of "seasoned water" as warm as that of the tank, is not bad) will help. If not, maybe a medication for bacterial infections may help.
They also note that other incurable illnesses may be at fault and euthenasia after a couple of days may be kindest.
Even items stuck in the mouth may do that to them! Take a look. :)