The 22-year-old Real Madrid forward has been subjected to frequent racist abuse this season and Brazil decided the friendly was a good opportunity to strike back as the match was staged in Espanyol's stadium near Barcelona.
In a powerful move Brazil abandoned their iconic yellow and green shirts and were instead kitted out in an all-black strip in a stand against racism for the first half of the game.
Vinicius himself, wearing the number 10 shirt, got on the score sheet with an 88th minute spot-kick, by this time kitted out in Brazil's usual colours. Newcastle forward Joelinton was well placed to tap-in the opener on the goal-line on 27 minutes while Rodrygo curled home the second two minutes later.
Stuttgart striker Serhou Guirassy pulled a goal back with a close range header on 35 minutes but Eder Militao restored the two-goal lead shortly.