J.S. Farmer & W.E. Henley, Slang and Its Analogues, volume 4 (1896) has a suggestively similar entry for mystery:
MYSTERY, subs. (common).—A sausage. Also MYSTERY-BAG.
English SYNONYMS. Bags of mystery; chambers of horrors; darbies; dogs (dog's meat or dog's body); mystery-bags; Sharps-Alley blood-worms; sore-leg ?
HENLEY, Culture in the Slums. 'O crikey, Bill!' she ses to me, she ses. 'look sharp,' ses she, 'with them there sossiges. Yea! sharp with them there BAGS OF MYSTEREE!'
Sportsman, 2 Feb. But the MYSTERY-BAGS of Sieur X, if we are to believe the common report, were far from fragrant. This gentleman has been sentenced to six months' imprisonment for 'making sausages of tainted meat.'
Eric Partridge, Dictionary of Slang and Unconventional English, fifth edition (1961) has this:
mystery. A sausage : somewhat low : from ca. 1885, ob[solete]. More gen. is bag of mystery, as in Henley, 1887, and much more gen. is mystery bag, as in The Sportsman, Feb. 2, 1889.
The use of "bag of mystery" appears to go back at least as far as 1873, where it is used as a synonym for the French harlequin and the English Punch's Puzzle. From an 1873 translation of Eugene Sue, The Mysteries of Paris [combined snippets]:
“Well then,” said the Ogress, turning to the other, “what will you have for supper, you bad lot?”
“Two tanners of wine, three slack-baked busters (small loaves) and a bag of mystery,” answered the Slasher, after luxuriously feasting his mind by mentally turning over the items of the White Rabbit's bill of fare.
A footnote linked to the phrase "bag of mystery" offers this explanation:
“Bags of mystery,” alias “Punch’s Puzzles,” in English cant, are the kind of sausage whose skins are filled with the various remnants left from the servants’ table in noblemen’s and rich men’s mansions.
An 1845 translation of Sue’s novel, however, refers to the “bag of mystery” as a harlequin, and then observes in a footnote,
A harlequin is composed of the remains of the eatables of all kinds, left at the tables of large French establishments, including fish, flesh, and fowl, vegetables and sweetmeats, fruits and cheese, and forms a profitable and saleable mixture amongst those who provide for the class to which the Chourineur [Slasher] belongs.
J.E. Lighter, Random House Dictionary of American Slang, volume 2 (1997) has this entry for mystery:
mystery n. meat of dubious origin served as hash, sausages, meat loaf, hamburgers, etc., esp. in institutional facilities. Now usu. mystery meat.
Lighter then provides a list of 24 citations ranging from 1877–78 to 1996 and indicating a fairly impressive continuity of usage for mystery and mystery meat over those years. The first mention of hash in connection with mystery is the first citation:
1877–78 Cornelian 86: Mystericum. Hash.
Other instances come from 1888, 1906, and 1921:
1888 in Amer. Heritage (Oct. 1979) 20: Our hash is ever cold, our hash is ever cold...I'm sure you'll open wide your eyes and at the "mistery" start.
1906 M'Govern, Sgt. Larry 52: "Will yez be afther havin' a wee bit of canned MYSTERY, sorr?" said Sergeant Tipprary, as he drew a half can of Armour corned beef hash from his haversack.
1921 15th Inf[antry] Sentinel (Mar. 25) 5: When "Mess call" sounds its welcome, you hurry to your seat/Of "beans" and "slum" and "mystery-hash" you get enough to eat.
"Mystery meat" dominates the later references—those from the 1960s onward—in Lighter.
"Mystery in the alley" probably combines the old idea of "mystery [meat]" either with the old commonplace description of a thing of dubious provenance as having been found "in the alley" or with (as Peter Shor suggests in his answer) a separately derived (and diner-specific) notion of "in the alley" as code for "on the side."