Yep, pin 5 is the middle mouse button, but I think jbenam was talking about games which rarely use the third button (I only know of one game that uses more than 2 buttons and that's Formula One GP, most only use 1), and even then, they don't use it as an output which is the real problem. Pin 5 is used for output for CD32 controllers though, so any game that supports a CD32 controller is liable to cause problems.
Anyway, here's a little schematic I knocked together that should sort out all your problems and enable you to use your Megadrive controller with any Amiga or Commodore computer without risk. Please not that I haven't built or tested it, but if you're familiar with a soldering iron it should take a few minutes to knock together, and you could probably build the diodes into a DB9 shell to make a very simple adaptor. Some schematics show the Megadrive controller to have a pull-up resistor on the Select line (pin 7 of the controller), but others do not. I suspect most do because if not I'm not sure they'd work with the Amiga at all (left and right might be disconnected), but I've shown it connected to +5V anyway to be sure it selects the correct controls. Button B is mapped to button 1, C is mapped to 2, and A and start do nothing.