Police said they found the bodies inside after storming the apartment in the city of Karlsruhe when they smelled something burning, several hours after a man barricaded himself and the hostages inside.
Authorities initially spoke of three or four dead but said they discovered the body of a fifth victim, a woman, presumed to be owner of the flat, during a search, a spokesman said.
Two of the other victims included a bailiff and a locksmith. Two further bodies have yet to be identified but are thought to include the hostage-taker.
"I am deeply shocked by the death of five people, including a bailiff of the Karlsruhe court working as a public servant for justice," said Baden-Württemberg Justice Minister Rainer Stickelberger, offering his condolences to the families of the victims of this "incomprehensible deed."
The minister promised that authorities would "investigate this horrible crime as quickly as possible."
Residents of the building had raised the alarm with police at around 9am when shots were heard from the home of the hostage-taker who was about to be evicted.
The fifth-floor flat was at the top of an apartment building in a leafy, middle-class neighbourhood, a few kilometres north of the city centre.
Specially trained police were sent to the scene which had been sealed off.
Two schools and kindergartens are located nearby and several apartment blocks were evacuated, according to the local daily Badische Zeitung.