The basic car is the same in this time frame and as long as the engines are the same the oil pans should be the same . There were however four gas engines and 3 diesel engines available in this series of BMW .
Gas
2.0 - 2.8 L M52 I6
2.0 - 3.0 L M54 I6
3.5-4.4 L M62 V8
4.9 L S62 V8
Diesel:
2.0 L M47 turbo I4
2.5 L M51 turbo I6
2.5 - 2.9 L M57 turbo I6
so as long as the engine is the same then yes it should be interchangeable. Hope this helps