When the fish got sick, did you notice any change in color on the sick fish? Did they get pale before they died?
Were there any symptoms other than the gasping? Were the fish "shaking" or "shivering", or scratching on things in the tank? Are any of the other fish showing any kinds of different behavior, color changes, etc? The fish that have died, did they also begin by not eating before they went to the gasping?
There are a lot of things this could be, but without being able to examine the fish hands on and without the ability to do an autopsy, it's impossible to say for sure.
What I can offer you is a preventive medication treatment to help protect the others if it turns out to be an internal parasite (which is almost what it sounds like) or any type of bacterial infection.
First I would treat the food with metronidazole. Simply take a very small amount (less than 1/8 tsp) of the powdered medication and put it into a zip lock baggie with some of the fish's flake food or pellet food. Shake up vigourously and keep seperate from the other food supply. Feed this once/day for 5 days.
Along with medicating the food, follow the instructions on the metronidazole for treating the tank water. Remove any carbon from the tank, and you may want to insert an air stone during treatment to keep the oxygen content up) WITH the metronidazole, also treat the tank water with neomycin, following the instructions on the packaging for dosing it.
Be sure you don't develop an ammonia spike during medicating, so follow directions for water changes according to the med's instructions and go easy on the food.
Keep us posted and let me know if there's anything more I can do to help. If you have questions about how to use or find the meds, also let me know and I will help.