What you have found is likely a magnetic reed switch, which is often used as a speed sensor, built more or less into the speedo. Put an ohmmeter on it and turn the speedo cable, the ohmeter should go back and forth between 0 ohms and infinity.