The incident was the deadliest to hit the Hajj in 25 years, with 769 people dead, more than 130 of them from Iran.
Mr Rouhani described the crush as “heart-rending”. As well as the fatalities, 934 people were injured.
Saudi Arabia’s Foreign Minister, Adel al-Jubeir, however, accused the Iranians of playing politics with a tragedy.
Mr Jubeir, who is also in New York to attend the UN General Assembly, said he believes Iranians should know better than to play politics with a tragedy that had befallen people who were performing their most sacred religious duty.
Saudi Arabia’s most senior cleric had defended the authorities, saying the stampede was “beyond human control”. King Salman had also ordered a safety review into the disaster.
The crush occurred on Thursday morning as two million pilgrims were taking part in the Hajj’s last major rite.
The pilgrims threw seven stones at pillars called Jamarat, which stood at the place where Satan is believed to have tempted the Prophet Abraham.
With temperatures around 46C, two massive lines of pilgrims converged on each other at right angles at an intersection close to the five-storey Jamarat Bridge in Mina, a large valley about 5km (3 miles) from Mecca.
It was the second disaster to strike in two weeks, after a crane collapsed at the Grand Mosque in Mecca, killing 109 people.