http://www.unixnerd.demon.co.uk/bmw.html
Code:
Gen Model Body styles Engine
E30 325i All M20
E36 325i All M50
E34 525i early Saloon M20
E34 525i late Saloon M50
E39 525i All M54
I'm assuming that M20's will share a common gearbox, as will M50's. No idea on M54s.