THats almost directly from the BSG Miniseries
Which in turn has probably swiped it from a dozen other sci-fi sources. Really now, the concept of isolating a serious fire from the rest of the ship and cutting off it's oxygen supply or venting that part of the ship's atmosphere to space is nearly as old as military sci-fi. (To the point where one of the Berserker novels mentions that the most dangerous Berserker-deployed missiles are the ones that start reactions
too exotic to be stopped by a mere lack of atmosphere, like a fire that has to be put out with liquid nitrogen.)