Hi,
Low frequencies are more important in these genres than in acoustic music. Therefore the way headphones reproduce these low frequencies is very important.
I'm not talking about ultra low frequencies. What happens below 40 Hz is no more (but no less) important than in acoustic music.
The frequencies specially involved in electro, much more than in acoustic, are between 40 Hz (lowest electro beat) and 150 Hz (highest synthwave beat).
That said, I don't think that the rules saying what is good and what is bad are different for electro music. Some will prefer the +10 dB bass boost, while other will prefer a flat bass response. Some might even like the weak response of HD600 / DT880 etc.
What I mean is that between two headphones that have a different sound both in the bass and in the medium / treble range, a slight inaccuracy in low frequencies might be acceptable for classical music, but become problematic for electro music.
But headphones with a better behaviour in both low and high frequencies will always be preferred for both acoustic and electro music. So my answer is : take the best headphones there are !
Only if you are forced to choose between two different not-so-good headphones, maybe one of them might suit electro music better than the other.