Vinicius, the 18-year-old Brazilian signed by Madrid last summer, capped an electric display at the Santiago Bernabeu with a stunning volley, his third goal for the club and the team's third of the night.
It will take a seismic comeback for Leganes to overturn the deficit in next week's second leg but more important to coach Santiago Solari was the rhythm regained, following two La Liga games without a victory.
The home crowd, who had whistled and waved white handkerchiefs on Sunday after the loss to Real Sociedad, were also treated to the sight of Brahim Diaz making his debut, the 19-year-old coming off the bench following his move from Manchester City.
Vinicius was the shining light, however. The striker was alive to every ball in the final third and his finish, a sweet shot with his body off balance, was a triumph for technical talent.
"He is taking big steps," Solari said afterwards.
"He has always had the ability but to develop it and show it in the Bernabeu, alongside so many great players, speaks of his confidence and his courage."
Vinicius had been at the centre of things last weekend too after being denied a controversial penalty during the second half of Real Sociedad's shock win.
Leganes had started brighter and could have been ahead had Martin Braithwaite been more precise with his finishing or quicker to a Gumbau pass across goal.
Instead, Madrid doubled their lead in the second half when Karim Benzema latched onto an underhit backpass from Bustinza and teed up Vinicius. He slid in Vazquez to finish.
Vinicius then got the goal his performance deserved as Odriozola floated a cross to the back post. Back-pedalling, the teenager adjusted his feet before swivelling into an acrobatic shot, the ball flying into left-hand corner.
Earlier, Antoine Griezmann helped Atletico Madrid edge towards the last eight as they took a valuable away goal from a 1-1 draw with Girona.
Neither side could find a winner at Montilivi but Atletico will be the happier, with the second leg at home still to come next week.
(This story has not been edited by Business Standard staff and is auto-generated from a syndicated feed.)