Hello and welcome to e health forum. â
The description of gasping and coughing could be due to respiratory infections like pharyngitis, sinusitis with post nasal drip, bronchitis or it could be due to asthma ( if wheezing is present).
Though night mares can present with sleep disturbances, persistant coughing and gasping is less likely to be due to that.
You might consult with a doctor for a examination , proper assessment and specific treatment of her condition.