You use it when you are in some sort of conflict and you decide to use the same means or tactics as your opponent.
By “better expression” do you mean one that more more aptly describes this sort of situation in general, one that more aptly describes the particular case in your link, or an expression that expresses a higher moral purpose?
Expressions that express a sentiment similar to “fight fire with fire” (not necessarily a better fit in this particular case)
“eye for an eye”
“what’s good for the goose is good for the gander”
“we’ll give as good as we get”
Expressions that express a higher moral purpose (you would use these if you choose not to act like your opponent or possibly not engage in conflict at all):
“two wrongs don’t make a right”
“eye for an eye leaves the whole world blind”
“we will not stoop to their level”