What the M5 has that makes it formidable is a dual clutch transmission that shifts much faster than the dated SMG-III sequential manual gearbox in the M6 and much more torque down low. That said, it is heavier with its porky ~4300 pound curb weight and it revs roughly a thousand rpm lower. The torque curve on the S63TU also drops off toward redline much harder than the S85 V10 which as a naturally aspirated design built for maximum power toward redline stays relatively flat. This is a battle of low end torque versus top end horsepower.
Horsepower wins. This same M6 also raced a Renntech tuned E63 AMG and you can watch that result here.
Skip to the to the 7:50 mark to see the race unless you are into watching cars stage as there is a lot of dead space in the video for some reason.