The knaves all disagree, so at most one of them can be telling the truth.
If one of them is telling the truth, then four of them are lying, so four ate the tarts. Hence Knave 4 alone is telling the truth.
If all five knaves are lying, then all five ate the tarts. But then this makes knave 5's statement true, which is a contradiction.
Therefore exactly one of the knaves (Knave 4) is telling the truth.
This problem is taken from the UKMT Mathematical Challenges.