Most reference sources endorse the use of "jig" rather than "gig" in
this phrase. Although both versions are commonly seen, "the jig is up"
has a lengthy history, while "the gig is up" is a relative newcomer
that may have originated with a variant spelling of the older phrase.
'lively dance,' c.1560, perhaps related to M.Fr. giguer 'to dance,' or
to the source of Ger. Geige 'violin.' Meaning 'piece of sport, trick'
is 1592, now mainly in phrase the jig is up (first attested 1777 as
the jig is over)."
Online Etymology Dictionary: jig
"Jig in this sense is indeed the same as jig meaning 'dance'. The
meaning shifted from 'dance' (mid-16th century) to 'music for such a
dance' (late 16th century) to 'a lively, jocular, or mocking ballad or
song' (also late 16th century). It evolved further to mean 'a light,
comical performance at the end of a play' (near 1700) and then 'a
joke, a jest, a sportive trick' (also near 1700). It is from that
latter meaning that we get the jig is up which means, etymologically
'the game is up' or 'it's all over'."
Take Our Word For It: The jig is up
Here's an excerpt from an interesting discussion of the phrase:
"The phrase 'the jig is up' surfaced more than 200 years ago. The
exact origin is unknown, with speculation ranging from the end of a
musical performance to the removal of a fishing line (a jig) from
water ? although the anglers' term didn't catch on until the 1860s, so
this seems unlikely.
Some scholars believe it originally referred to the end of either a
trick or game, since the word jig (sometimes spelled gig) had acquired
this meaning by the time Shakespeare was writing plays.
The first recorded use of 'the jig is over' appeared in 1777. About 20
years later, a Philadelphia newspaper published the earliest known
version of our current expression ? throwing in an extra 'g' (the jigg
is up) for good measure.
What does 'the jig is up' imply today? The Canadian Oxford defines it
as a scheme that's been 'revealed or foiled,' while Webster's suggests
it means 'all chances for success are gone' ? especially when applied
to 'risky or improper' strategies.
The gigantic Oxford English Dictionary broadens the scope to 'the game
is up, it's all over.' The Gage Canadian Dictionary says the
expression is slang for 'it's all over; there's no more chance,' and
The Houghton Mifflin Canadian Dictionary of the English Language
offers a similar entry: 'the game is up; all hope is gone.'...
Musicians have called short-term jobs "gigs" since the early 20th
century ? especially one-night engagements.... Although there is no
reason we couldn't start saying 'the gig is up' to mean 'the gig is
over,' the phrase isn't well established.
'The jig is up,' on the other hand, is cited by lexicographers all
over the western hemisphere. Indeed, in his Dictionary of Historical
Slang, Eric Partridge points out that 'the jig is up' was actually
'standard English' until 1850, when it slid down a few notches to
CBC News: GIGS, JIGS, AND JIBES
My Google search strategy:
Google Web Search: "gig is up" "jig is up" correct
I hope this is helpful! If anything is unclear or incomplete, please
request clarification; I'll be glad to offer further assistance before
you rate my answer.