The story
Apparently from the longer childish playground taunt sung to a tune particular to the taunt: : I'm better than you, : na-na, na-na, boo-boo, : stick your head in doo-doo. Na-na and boo-boo may be imitations of sounds a baby or young toddler might make. Boo-boo may also indicate boo-boo, a minor injury which leaves a mark on a child such as a scraped knee.
First known use, by meaning
- c. mid 20th century? A taunt or putdown, typically used to indicate that the speaker believes they has beaten the listener in a competition or is better in some other way or in a general sense; or an expression of satisfaction that the listener has received some supposedly deserved minor punishment or misfortune (that is to say, schadenfreude).
Etymology from Wiktionary, CC BY-SA 4.0.