mid-15c., "to choke, strangle," possibly imitative or influenced by Old Norse gaghals "with head thrown back." The sense of "stop a person's mouth" is first attested c.1500. Related: Gagged; gagging.
"joke," 1863, probably related to theatrical sense of "matter interpolated in a written piece by the actor" (1847); or from the sense "made-up story" (1805); or from slang verbal sense of "to deceive, take in with talk" (1777), all perhaps on notion of "stuff, fill" (see gag (v.)).