Fighting fire with fire is an idiom meaning a response to an attack with a similar or equal attack (i.e. if someone fires a weapon at you, you fire a weapon at them).
In a negative context:
Set a thief to catch a thiefProv. The best person to catch a thief is another thief, because he or she knows how thieves think. The government set a thief to catch a thief, hiring a stockbroker convicted of fraudulent practices to entrap the stockbroker they were investigating for fraud.