morbid impulse

mor·bid im·pulse

an impulse that drives one to commit some act, usually of a deviant or forbidden nature, notwithstanding efforts to restrain oneself.