Morocco enjoyed most of the ball for the opening 15 minutes of the first half, although they were let down by their decision-making in the final third.
It took a while for Iran to get going, but they eventually showed some attacking intent although they failed to test Morocco's Munir.
The game's first clear-cut chance arrived just before the halftime break but Iran's Sardar Azmoun failed to beat Munir from close range.
The second half continued in same fashion as the first, although Iran looked more threatening.
However, chances were few and far between, leaving both sides to try their luck from distance.
Morocco were dealt a blow with 15 minutes remaining after Watford's Nordin Amrabat was forced off with an injury and replaced by his brother, Soyfan.
The encounter seemed destined for a draw Saint-Petersburg Stadium until Aziz Bouhaddouz miscued his header into his own in second-half stoppage time to hand Iran three points.