One of the nice things about e36s is that parts are, for the most part, quite interchangeable across all 8 production years.
The way to check is to go to realoem.com and check the part number for your car and for the donor car. Also, junk yards have books where they can look this up.
If you HAD trashed the DME, that would have been a very specific part number that varies by model year, transmission, and differential. Most other parts are pretty universal.