This episode was inspired by two episodes of All in the Family: "Archie in the Cellar" which features Archie Bunker locked in the basement for an extended period of time and "Two's a Crowd" in which Archie and Mike Stivic being locked in a storeroom, the sharing of dark secrets). Both episodes were essentially one- and two-man plays, much like "Brian & Stewie." As noted on the page for All in the Family, Seth MacFarlane and producer Kara Vallow are big fans of the show.
The plotline is also derived from The Twilight Zone episode "Time Enough at Last". In "Time Enough at Last", Henry Bemis is reading a copy of David Copperfield, which Brian is also revealed to be reading.
When Brian licks Stewie's buttocks, Stewie sings "MOOOOOOOOOOOOOOOOON RIV-EEEEEEEEEEEEEEER!" in a high falsetto, a reference to Fletch when Chevy Chase's character reacts the same way during his prostate exam.
The musical part of the program featured an instrumental number called Errand Boy which was a tribute to a similar number in the Jerry Lewis movie The Errand Boy. The music being played is "Blues in Hoss' Flat" by Count Basie and His Orchestra.