The site baseball-reference.com
is baseball stats geek's paradise. There's an incredible amount of team and player statistics from 1876 forward. One of the very cool features on the site is called "Oracle of Baseball."
Oracle of Baseball
Enter the names of any two major league players and "The Oracle" will "link" them by a shortest possible list of teammates. There's a simplifed version of it below. In the sample, I entered one of the earliest pitchers, Dale Williams, from the 1876 Red Stockings and the 2013 Cy Young Award winner, David Price of the Rays. Give it a try!
The full version on their site is http://www.baseball-reference.com/oracle. There's additional functionality there (exlude certain players, how connected a player is, etc.)
Enter names as "first name 'space' lastname"
How They Are Linked