Iran striker Karim Ansarifard opened the back of the net in the 88th minute.
The friendly was held at the 45,000-seater Otkritie Arena, the home stadium of Spartak Moscow.
The World Cup will get underway on June 14, with the matches set to take place in 11 cities across Russia.
Iran has been drawn in Group B along with 2010 World Cup winner Spain, reigning European champion Portugal and Morocco.
Iran will begin the campaign on June 15 with a match against Morocco.