James D. McElroy (November 5, 1862 – February 24, 1889) was an American professional baseball player who played one season at the major league level. He pitched thirteen games for the Philadelphia Quakers, and one game for the Wilmington Quicksteps. His W–L record was 1–13, and he had an earned run average of 5.12. He attended Saint Mary's College of California in Moraga, California.
He was first seen on May 2, 1884, pitching for the Baltimore Monumentals of the Eastern League, when he pitched against the Quicksteps. Before the 1884 season, Harry Wright took over as the Phillies manager, and was a fan of McElroy's talent. In McElroy's 14 starts, there were seven different catchers who caught him, four of whom claimed that he was the first pitcher they had ever caught at the major league level. In an era when catcher's equipment was still very meager, and with no other catchers willing to work with McElroy, Wright was therefore forced to release him.
McElroy became addicted to drugs and alcohol, and died at an opium den in Needles, California after being injected with morphine by an unknown person while he was unconscious or in stupor.