Gain and loss in an optically pumped mid-infrared laser