for the master system this information seems to have a small mistake in it, pin 8 in this document is listed as "power", when it is in fact ground. Each button (left, right, button 1 ect.) is in fact a voltage(very small), this voltage is grounded to result in movement, fire, jump ect. for standard master system controllers this is dirrectly feed to the system via wires only (some other controllers use a micro chip) they also are not connected to voltage (the higher voltage listed at pin 5 in your artical), while some others do.
another important thing to note is that the diagram is listed as a 9 pin D-SUB female connector. according to the pin listings this is looking at the end of the controllers plug, NOT the ports on the console. although i am not entirly sure, i think this would be classed as a male 9 pin d-sub connector. perhaps listing the view as the end of the controllers plug would be helpfull.
hope this helps
above refers to the artical named
SegaMaster System (SMS) and MegaDrive joystick pinout