Possibly. We do know that the term showed up for the first time in the Boston Globe in 1886 to refer to baseball players, for whom muscle cramps in the leg are an occupational hazard.
But why Charley horse? There are a few versions of the story, although associating it with pitcher Charlie Esper (who tended to limp) is incorrect as he didn't start playing until almost a decade after the term showed up.
Another version says that the horses used to drag the field were nicknamed "Charlies" and tended to be old horses unfit for heavier work.
The most common folk etymology, however, is that the term was coined by a player named Joe Quest, and when he was an apprentice machinist, he knew an old white horse that was pretty lame and named Charley...and apparently people trying to walk with leg cramps reminded him of said horse. This seems the most likely (and possibly shows the power of the press in getting a slang term started and popular).