An own goal by Sergiy Kryvtsov, who turned in a Lucas Vazquez cross, gave Real a one-goal lead at the break.
Vinicius scored twice in five minutes after the restart, sweeping in from close range before beating three players to add a brilliant third.
Rodrygo swept in Vinicius’ pass before Karim Benzema slid home late on.
It was a superb second-half display by Real and in particular Vinicius, who continued his fine run of form this season.
The 21-year-old has now scored seven goals in nine appearances for Real in all competitions – and these were his first in the Champions League this season.
Victory means Real are second in Group D, level on six points with leaders FC Sheriff, who lost 3-1 at home to Inter Milan.
The Serie A side ended the Moldovans’ perfect start in their debut Champions League campaign as goals from Edin Dzeko, Arturo Vidal and Stefan de Vrij secured victory. Sebastien Thill had briefly levelled for Sheriff.