First off, the oil filter housing is the same for all of the 3-series S50/52 and M50/52 motors.
If you’re ever in doubt, you can double check this kind of thing at realoem.com. Look up your car, find the part number as it applies to your model, then backtrack to the first page and paste that number into the part # application search. Pretty handy way to find cross-reference parts!
If you’re not seeing any oil leaking along the casting plug area of your housing, I wouldn’t mess with it. You should be able to see pretty easily if you have a leak back there once you have your housing off.
I found this write-up of someone who hacked a solution on a 528i with an M52:
Slightly different part because of the attachment point of the P/S reservoir, but basically the same idea.
The gasket replacement itself is pretty straightforward, but you do need to remove a bunch of parts to get to it. If you’re not draining your oil first, be sure to at least open up the oil filter lid so any oil drains back to the block before you take off the housing.. it will be quite messy otherwise.