The five casualties, one of them a firefighter on a rescue mission, drowned in Serbia. Bosnia and Serbia declared a state of emergency, while the Serbian Orthodox church said it would hold special prayers in Belgrade for the rain to stop.
"This is the greatest flooding disaster ever. Not only in the past 100 years; this has never happened in Serbia's history," Serbia's Prime Minister Aleksandar Vucic told a news conference. "More rain fell in one day than in four months."
In Bosnia, army helicopters evacuated dozens of people stranded on the top floors of their flooded homes in the central town of Maglaj, where the Bosna river swelled to record levels and swept away the main bridge. Rescuers used boats to reach stranded victims.
Doctors said one man in eastern Bosnia died of a heart attack while trying to save his cattle from drowning.
Special police were trying to reach the northern Bosnian town of Doboj, which was cut off from the rest of the country after all major roads out were flooded.
The Bosnian government ordered the defence ministry to use troops to help thousands of civilians whose homes were engulfed by water, particularly in the central and eastern regions.
"This is the worst rainfall in Bosnia since 1894, when weather measurements started to be recorded," said Zeljko Majstorovic, a Sarajevo meteorologist. He said the rain, which began on Tuesday, would continue until the end of the week.
Many roads were deluged and towns and villages completely cut off. Schools were closed across both countries.
Serbian Energy Minister Aleksandar Antic said power supplies were cut to around 100,000 households, mostly in central Serbia.
Serbia's power utility Elektroprivreda Srbije (EPS) said that high water levels on the Morava river had forced it to halt two hydro power plants there.
A major highway from Belgrade to Macedonia and Bulgaria was flooded and the traffic interrupted. The main south-bound railway line to Montenegro's port of Bar was also closed down, as well as the one linking Doboj in Bosnia to Belgrade.
Bosnia's utilities, Elektroprivreda BiH and Elektroprivreda RS, said around 50,000 households were without electricity across the Balkan country.