Abdelaziz Hatim also scored for Qatar, who were invited as guests in the tournament, in the quarter-final clash in Arizona.
Just six minutes later, Hatim hammered a right-footed shot into the goal to make it 2-0.
El Salvador were called for a hand ball in the 55th minute, which resulted in Ali scoring his second goal of the game off a spot-kick to give Qatar a commanding three-goal lead.
But El Salvador were not about to go quietly and their comeback started in the 63rd minute when Amando Moreno passed to Joaquin Rivas who scored his side’s opener.
Rivas scored again 11 minutes later with a left-footed kick but Qatar held on to seal a spot in the last four.
Holder Mexico reach semis
Meanwhile, Mexico took another step towards defending their title by scoring three first-half goals en route to a 3-0 rout of short-handed Honduras.
The holders cruised past a depleted Honduras squad that had lost several players to injury and COVID safety protocols.
Striker Rogelio Funes Mori scored a header in the 26th minute to open the scoring for Mexico, who will next face either Canada or Costa Rica.
Jonathan Dos Santos and Orbelin Pineda then scored seven minutes apart to break the game open at the State Farm Stadium in Phoenix, Arizona.