With Spain and Portugal the other teams in Group B, this was regarded as a must-win game in St. Petersburg for two of the tournament outsiders.
Your browser doesn't support video.
Morocco started brilliantly, hounding Iran's every touch and swarming forward with such ferocity that on the line, Queiroz spent most of the opening 20 minutes urging his players to pause, and take a breath.
Going into injury time in St Petersburg, it looked like being a result neither Morocco or Iran wanted, before Morocco's Sofyan Amrabat conceded a needless free-kick by fouling Saman Ghoddos near the corner flag.
It was only Iran's second win in 13 matches at the World Cup and the first win for an Asian team in the tournament since 2010.
Captain and central defender Jalal Hosseini and right back Steven Beitashour have prior World Cup experience, having played at the 2014 edition while Voria Ghafouri - who can be employed as a winger or a full back - is also a veteran in the team.
Herve Renard, despite being a two-time AFCON winning coach, will be managing his first ever game at a World Cup when Morocco take on Iran. However, they have never reached the knockout stages, winning only one of their 12 games (D3 L8) - against US on 21 June 1998 (2-1).
The best chance of the first half fell to Iran's Sardar Azmoun, though, who bore down on goal after latching onto Omid Ebrahimi's throughabll, but his shot was too low and Munir Mohamedi saved low with his feet.
When Bouhaddouz nodded in at the near post, Iran's substitutes could not resist rushing onto the field and when the final whistle blew moments later they were sprinting over again in delight.
"In a competition where three matches need to be played, as long as there as still two matches to be played, whoever the opponents there is still hope", he said.
Morocco have qualified for their fifth World Cup, their first since 1998.
Iran kept only their second World Cup clean sheet - their other came in a goalless draw with Nigeria in June 2014.
"Carlos Quieroz always has a surprise, but we've been watching Iran's games for six months".
However, Carlos Queiroz's charges were settling in the game after 25 minutes, although clear-cut chances were still hard to come by for nations.