Having driven both I can say that a 740i is a genuine slug, while an M5 is pretty quick. A friend has an Evo and his father has both a 993 and 996 turbo. Interestingly, the Evo is faster than both Porsches in any situation with corners. I would imagine that a good handling WRX with reasonable HP would be a formidable opponent as well.
As an aside, I just had a nice race along the top of the hills here with a normally aspirated 996 and a 318i. The 318 was kinda outclassed, but handled pretty well. Since the 996 was behind me it was hard to tell for sure, but it seemed like I could add distance between us when I really tried. The WRX's ability to put power down early and hard is a huge advantage on twisty roads with bumps and such. All in all, big fun. Still looking for an E46 to humiliate!