The pin 5 is somehow linked to the magnetic strip reader inside the AF-S/AF-I lens. This is only presented in lens with built in AF motor and the frequency of output is related the rotation speed of the AF element. See the image below for reference from service manual.
And some additional information, it seems the new AF-S lens has flash memory inside their rom chip and host all the lens correction information in it. And the firmware of the lens can be flashed through the body. I never seen this in older AF-D lens.