In some ancient societies (and possibly current ones) when the leading authority figure (President, King, Dictator, etc - in this case Hokage) is unable to make official decisions or unable to attend certain meetings, a substitute is sent in their place. Most societies choose these substitutes well in advance and give them certain power matching the one they're replacing (declaring war, honoring citizens, change of laws, etc).
In this case, since Tsunade was out-of-action due to her coma, it was decided to find a replacement to represent and protect Konoha. This replacement was intended to be the sixth Hokage, either forcing Tsunade into retirement if she were to wake up or to take her place if she passed on. However, in order to become an official Hokage, it was mentioned that the Jounin would have to vote for the final decision. Since that never happened, Danzo was never an official Hokage - even though he was already on the path of becoming one.
The reason why the other Kages referred to him as Hokage was because for all they knew, he was. Konoha wasn't going to let other nations know they were without a proper Hokage. Even so, I remember they often called him "Konoha," which resembles more of what he was - a representative than an official leader.