I had the same issue with my 1997 328i, I did a few things and it fixed the problem for good! Here is what I did: There is a problem with the brake light switch going out *intermittently* for older E36's (like you're experiencing) so I replaced that....its pretty difficult to do yourself but if your determined and do your research on the DIY forums you can do it (I struggled getting the switch out-took me about an hour). The brake light switch is located underneath the steering wheel, right above the brake pedal, remove the panel-there's three screws, two towards the top, one down to the right. There are two clips holding the panel in place on the outer side-where the door runs flush against it, you just have to hold onto it and pull it towards you to un-hook the clips then use a screw driver to pry it away. Then you want to unhook the electrical wiring attached to the panel as well as pop out the light. You'll now have to get your head upside down and under there to see it, its a small black part with a red tip, pry it out with a screw driver (doesn't matter if you break it cause you're putting a new one in there anyways!) pop the new one in and presto! Be careful when putting the new one in-it can break easily. I also replaced both the bulb sockets because like the previous posts say, they corrode easily because rain water can get in through the little cracks in the light casing. If that doesn't fix it, then replace the fuse, which you already know. If all else fails, it's most likely faulty wiring which is really difficult to deal with.... also replacing the casing is difficult too and its expensive, about $250 just for the part..........might want professional help on that. Good luck!
Brake Light Switch: $25 on bavarianautosport.com
Bulb socket: $7 each