If you're not an experienced race car driver, the chances are that you'll be quicker in an automatic vs a similar manual gearbox car, + torque wins races. The 500E peaked @ around 350ft/lbs torque @ around 4000rpm. The M5 peaked @ around 270ft/lbs torque @ around 5000RPM.
I suspect that where the M5 is ahead, is in fun per sq/in of seat cushion.