“Wicked Willie’s Dream” by Walter M. Dunk appeared in Harper’s Round Table, vol. XVI, no. 821, 23 July 1895, 760 (click for full story):
It clearly anticipates Winsor McCay’s Little Nemo in Slumberland, in particular for Willie’s position after his fall, but the idea of explaining an uncanny series of events as a dream at the very end of the story had been floating around for a long time. Sigmund Freud included a cartoon which might be taken from McCay’s Dreams of the Rarebit Fiend in his Interpretation of Dreams (1900):
Clicking on the image you will get an image of the page annotated by Sàndor Ferenczi from the Library of Congress Freud collection.
Edward Lear’s early picture story, “The Adventures of Daniel O’Rourke” (from Lear in the Original (New York: H.P. Kraus, 1975, 185-98, see earlier post) — adapted from “Daniel O’Rourke,” in Fairy Legends and Traditions of the South of Ireland (London: John Murray, 1834, 134-44) — ends in the same way, with the metamorphosis of a whale into Daniel’s wife Judy, who wakes him from his alcoholic nightmare:
Note the caption with its pun on interrupts / interprets.
Dunk’s strip seems to belong to a tradition in which the bad dream prompts the reformation of the “wicked” dreamer, which will reappear in newspaper comics, for example in William Steiningns’s The Bad Dream that Made Bill a Better Boy, which ran in the New York World from 13 August 1905 to 16 April 1911: