解:设张阿姨第一次购买荔枝$x\ \mathrm {kg},$第二次购买荔枝$y\ \mathrm {kg}$
根据题意,得$0<x<25$
$(1)$当$0<x\leqslant 20、$$y\leqslant 40$时,
根据题意,得${{\begin {cases} { {x+y=50}} \\{6x+5y=264}\end {cases}}}$
解得,${{\begin {cases} { {x=14}} \\{y=36}\end {cases}}}$
$(2)$当$0<x\leqslant 20,$$y>40$
根据题意,得${{\begin {cases} { {x+y=50}} \\{6x+4y=264}\end {cases}}}$
解得,${{\begin {cases} { {x=32}} \\{y=18}\end {cases}}}($不合题意,舍去)
$(3)$当$20<x<25$时,则$25<y<30,$
此时张阿姨用去的钱数为$5x+5y=5(x+y)=5×50=250<264($不合题意,舍去)
答:张阿姨第一次购买荔枝$14$千克,第二次购买荔枝$36$千克$.$