Chasing a first men’s football gold since 1992, Barcelona’s Lopez capitalised on an error to put the Spanish in front midway through the first half at Bordeaux Stadium.
The Dominican Republic hit back with a header from Angel Montes de Oca, but their task was then made harder in first-half injury time when captain Edison Azcona was shown a straight red card for kicking out at Pau Cubarsi.
It made for a long second half for the Dominican Republic, who qualified for the Olympics after making the final of the 2022 CONCACAF Under-20 Championship.
And Spain soon pressed home their advantage, with Baena’s deflected shot restoring their lead in the 55th minute.
After a VAR check for offside, Miguel Gutierrez then added Spain’s third after tapping in from Lopez’s cross.
The victory means Spain are already through to the quarter-finals having also won their opening match 2-1 against Uzbekistan.
Spain face Egypt in their last group game on Tuesday.