A 5yo kid won't understand or like the ruin itself. They will enjoy the nature, the forest around Machu Picchu, run along the grass, they will probably want to climb the stone (forbidden), but just for a while I guess. If they get hungry during the tour, they may get upset, or what if they want to go to the bathroom while you are going up to the viewpoint?, so at the end I think it will be complicated. As SJOGuy said, it may be a long day (they may get bored in the train, specially the way back to Cusco, it's too long for a kid).