There's an interesting article at Wikipedia, as usual.
From etymonline.com:
-Tim1926 (in Maine & Grant's "Wise-Crack Dictionary," which defines it as "a device used for making a fair game crooked"), Amer.Eng., perhaps an alteration of gimcrack, or an anagram of magic.