The day before Diwali is Naraka Chaturdashi, which is believed to be the day when Krishna killed the demon Narakasura. Some believe that Diwali is celebrated to commemorate this event, as it symbolizes the triumph of good over evil. This Wikipedia page mentions this same belief.
It is believed in some traditions that before Narakasura's death, he requested a boon from Satyabhama (incarnation of Bhudevi), that everyone should celebrate his death with colourful lights. Thus, this day is celebrated as 'Naraka Chaturdashi' - the beginning day of Deepavali
Is it folklore or are there any references to it in our scriptures? I have already gone through this answer. It doesn't even mention about Nara's death as part of the 5 day celebration.