The electric car has virtually no drive-train loss. It also has near full torque at 0rpm. The power ratings are at the flywheel for the combustion engine. The power rating for the Tesla is basically RWHP. Do the math. Not to mention the Tesla is AWD. The Tesla is a beast.
I doubt it has the same track capability as the M5, though. But how many owners honestly take their M5 to the track? It's not much of a track car tbh. Too much of a fatty.