The 4th Doctor serial "The Talons of Weng-Chiang" doesn't quite fit, but it's maybe close enough if you're not remembering perfectly? (There's a detailed description of all six parts on this page).
The story features a "time cabinet" from the 51st century (era of the Time Agents like Jack Harkness), which is based on the unstable "zygma energy" and that has disrupted the DNA ("split open so that more and more cells are being absorbed") of the villain, Magnus Greel, who needs to regain the lost cabinet in order to live.
The villain has a machine that he uses to extract the "life essences" from young women to keep himself alive in the meantime (I don't recall the Doctor being threatened with this, but Leela is nearly killed by it).
The end doesn't really match your description, though: the Doctor throws Greel into the machine, which causes him to disintegrate, and he destroys the key to the machine (a "Trionic Lattice"), ending the "Zygma Experiment".