I think awk is exactly the right tool:
awk '$5 != last; {last = $5}' last=-1 input
Note that this prints a line 'if the 5th field does not match the value in the line before', but does not 'print every last occurrence of a value'. But I do not fully understand the second to last sentence in your question, so I'm ignoring it since it seems to contradict the last sentence of the question.
If what you want is to print a line only if the 5th field of the next line is different, try:
awk '$5 !=b && NR>1{print a} {a=$0; b=$5}' input