Origin of bottom dog

First recorded in 1880–85; by analogy with top dog