For any integer n the difference n3 - n = (n-1)n(n+1) is the product of three consecutive integers. One of these factors should be divisible by 3, and at least one factor should be divisible by 2.
So, n3 - n should be divisible by 6.
This means that (sum of third powers) - (sum of original numbers) is divisible by 6.
If the sum of numbers has the remainder 5 in division by 6, then the sum of their third powers has the same remainder 5 in division by 6.