Your answer is correct, assuming that positive acceleration of the 5Kg mass means it rises and negative acceleration means it falls. What do you get for tension in the cable - if it's between 4g and 5g newtons then the 5Kg mass falls while the 8Kg pulley rises.