iirc the ArrayCount() function will return the upperbound index of the array, then you can use that value, -1, -2, -3, -4 to get the last 5 elements in the array
say you had 10 items in the array, the arraycount would be 9 (elements start at 0, so your array is 0-9 (10 elements))
so something like:
iUB = arraycount(your_array)
iVal1 = your_array(iub)
iVal2 = your_array(iub-1)
iVal3 = your_array(iub-2)
iVal4 = your_array(iub-3)
iVal5 = your_array(iub-4)
Just be sure iUB is => 4 before doing the above, if the element doesn't exist it will go boom. Im sure theres a bunch of different ways to do what you want, the above is just one
In general I'd be careful about growing an array over the life of the app, could get dodgy if it gets too big and eats your memory