Mexico needed just to avoid defeat in Recife to take their place in the knockout phase, but three goals in ten second-half minutes killed off Croatia's hopes.
The Mexicans needed more than an hour to break the deadlock at the Arena Pernambuco before the floodgates finally burst.
Marquez scored with a header on 72 minutes before Andres Guarado grabbed Mexico's second and substitute Javier Hernandez netted a third in quick succession to book their Dutch showdown at 1300 local time (1600GMT) on Sunday in Fortaleza.
Ivan Perisic grabbed a late consolation for the Croats before replacement forward Ante Rebic was sent off just before the final whistle.
Croatia bow out by finishing third in the group after their opening 3-1 defeat to Brazil and 4-0 trouncing of Cameroon, while Mexico finish second in the table to Brazil on goal difference.
Coach Niko Kovac had recalled defender Sime Vrsaljko for Croatia, with left-back Danijel Pranjic pushing up into midfield, but it was a move that ultimately didn't pay off.
The Mexicans were unchanged from the side that held hosts Brazil to a goalless draw last Tuesday thanks to the heroics of goalkeeper Guillermo Ochoa.
Mexico coach Miguel Herrera opted to again leave Hernandez out of his starting line-up before the Manchester United star netted after coming on for the final 25 minutes.
The Mexicans had the best of the opening exchanges when Hector Herrera's long-range shot beat Croatia goalkeeper Stipe Pletikosa, but thundered off the crossbar on 16 minutes.
Croatia fired in numerous crosses, but Mexico goalkeeper Ochoa was again solid between the posts.
After a goalless first-half, the Mexicans got the breakthrough when Herrera's corner was powered home after Marquez out-jumped the defence on 72 minutes.
Croatia threw everything forward to find an equaliser, but left spaces at the back which Mexico exploited with their second goal just three minutes later.
Valencia's Guarado finished off a lightning counter-attack on 75 minutes to leave Croatia on the ropes.
Mexico then grabbed their third when another Herrera corner was flicked on by Hector Moreno for Hernandez who nodded home at the back post on 82 minutes.
Perisic grabbed a late goal for Croatia when he converted Ivan Rakitic's final pass just before Rebic was shown a straight red for taking out Carlos Pena on 89 minutes.