Write a code segment that uses a while loop, the input function and any other necessary code to efficiently accumulate the total of the numbers inputted by the user that are between or including 5 and 9. Trace the code assuming the user inputs the values 6, 9, 3, 5 and -1 where -1 is a sentinel value that causes the loop to terminate.