The life-cycle of gas in dying galaxies