"Justify My Love" was written by Lenny Kravitz, Ingrid Chavez and Madonna. Kravitz wrote the song for Madonna, based on a poem written by friend and Prince protégé Ingrid Chavez. Kravitz added the title hook and chorus. Madonna contributed a few lines. Chavez was not credited for the song and later sued Kravitz in 1992. She received an out-of-court settlement, and gained a co-writing credit. The song was released on November 6, 1990, three days before the release of the compilation.
Producer Kravitz used the intro found on Public Enemy's instrumental, "Security of the First World", without consent, which was in turn based on the end drum break of James Brown's "Funky Drummer", and used it as the basis of the song.