like cures like

клин клином вышибают
see also [fight fire with fire]

? Habit cures habit.