maybe. I think the diameters of the MAF sensor tube and that of the ECIS intake are the same for the e46 and CERTAIN e39s. Now as far as the box and other internals, your best bet is to take a look at the interior of the engine first.
A forum community dedicated to BMW E46, E90, and F30 owners and enthusiasts. Come join the discussion about M performance, turbo kits, engine swaps, builds, modifications, classifieds, troubleshooting, maintenance, and more!