The 5-4 shoot-out win exacted revenge for a humiliating 7-1 World Cup semi-final defeat to Germany two years ago.
Olympic gold was the only major title to have escaped five-time world champions Brazil in their history.
But Barcelona star Neymar righted that historical wrong as he fired the winning penalty into the top corner before breaking into tears.
The final had ended 1-1 at the end of normal and extra-time.