The Op's pics show 3 leaflets but the Vitex show 5. The serration of Vitex doesn't go all the way to the tip of the leaflet. It'd be helpful if we knew more about the plant, where it is and some more pics.
It is not melia or vitex. this tree is growing in the northern suburbs of Cape Town, but does not look indigenous to South Africa. I have asked at nurseries but no one seems to know what it is. it has a resin that irritates the skin and can cause blisters.