It looks like it might fit, but I'm hoping people more knowledgeable regarding gearboxes will chime in.
The syncros on my 4th gear are bad, and it pops out most of the time, so I'm looking to replace it soon.
Saw this on craigslist. It's a '95 BMW E36 M3 Transmission. Would it bolt up?

It might, but it'll be at an angle so your driveshaft will need to be a different size, and shift linkages will have to be bent.
Not to mention, now you'll lose your overdriven .85:1 5th from the E30 tranny, getting a 1:1 5th on the M3 tranny WHICH SUCKS with a 4.10. Your rpms on the highway will be astronomical at minimal speeds.
I say find another Getrag 240 box from an E30 with an M42.