He spoke to UP Chief Minister Akhilesh Yadav, Bihar Chief Minister Nitish Kumar and Madhya Pradesh Chief Minister Shivraj Singh Chouhan, official sources said.
Modi said Home Minister Rajnath Singh was closely monitoring the situation and had spoken to Chief Ministers of the five states to take stock of rescue and relief operations.
"I pray for the safety & wellbeing of those in areas affected by floods in parts (of) UP, Bihar, Uttarakhand, Rajasthan & MP," he tweeted.
In Madhya Pradesh, torrential rains have lashed western parts disrupting normal life.
The Ganga had yesterday crossed the danger mark in West Bengal, Bihar and neighbouring districts of Uttar Pradesh where Yamuna river is also in spate, while heavy rainfall has created a flood-like situation in some parts of Rajasthan where six persons have died so far.