A comparison theorem in homological algebra