Brazil, who are yet to win Olympic soccer Gold, created the better chances, but they either failed to put them away or outstanding goalkeeper Emmanuel Daniel and his defence were resolute in keeping them out.
Ubong Ekpai fired the match winner for Nigeria off a rebound after just four minutes.
Thereafter, Brazil threw everything at Nigeria, coming close in the 19th minute through Felipe Anderson and on 27 minutes, when Alisson’s angled header crashed against the crossbar.
Turkey-based Nigeria defender Musa Mohammed was booked in the 16th minute.
For the second half, Brazil made three changes, throwing in Wallace, Clayton and Wendell.
Clayton threatened the Nigerian goal just two minutes after his introduction, but goalkeeper Daniel was alive to his responsibilities.
Malcolm and Andreas Pereira of Manchester United were also brought on but they just could not get past the Nigeria backline even after seven minutes of additional time.
Brazil will play another friendly against South Africa on March 27 in continuation of their build-up for the Rio Olympics in August.
The draw for the tournament will be staged in Rio next month.