The message of Daniel 5 is the contrast it offers between Nebuchadnezzar and Belshazzar:
Nebuchadnezzar is humbled by God, learns his lesson (he acknowledges the ultimate kingship of the God of Israel), and is restored to his throne;
Belshazzar, in contrast, learns nothing from Nebuchadnezzar's example, blasphemes against God, and his kingdom is given to others.