This is an area that I'm not too familiar with on E36's. I went to Real OEM and compared DME's. They appear to be the same module but I doubt they are interchangeable in between cars because of the difference in the tune between the M52 and S52 motor. It appears that the module itself is identical and it might plug in but I don't think your 328 will start with an M3 DME. This is particularly an issue if you have an automatic transmission because BMW's with automatics and manuals have different coding.
Long story short, I don't think it's going to work and if it did you would probably have to pay for a reflash.