Exhaustion is a special condition which has multiple levels. From the PHB p. 291, all emphasis mine:
Level Effect
⋮
6 Death
Exhaustion is measured in six levels.
A creature suffers the effect of its current level of exhaustion as well as all lower levels.
Death ward is a 4th level spell which, amongst other things, has the following effect (PHB p. 230):
If the spell is still in effect when the target is subjected to an effect that would kill it instantaneously without dealing damage, that effect is instead negated against the target, and the spell ends.
This means that since the effect of the sixth level of exhaustion is instantaneous death—in that it happens at the instant the sixth level is gained—then the quoted clause of death ward triggers, upon which the spell ends. However, since the level of exhaustion is not removed by the spell—only its effect negated—it is unclear how to resolve the situation which results: does the creature 'suffer the effect' of the six levels of exhaustion, dying (again), or is there any basis to another interpretation?
This begs the question: what happens when a creature under the effect of death ward suffers the sixth level of exhaustion?
Best Answer
The creature will not reach 6 levels
Exhaustion itself is a condition, not an effect. From the definition on page 291 DMG:
When you are on level 5 of exhaustion, and you are subjected to an effect that would increase your level to level 6 (or beyond), thereby killing you instantly, the effect that causes this is negated, death ward ends and you instead remain on level 5. The next effect increasing your exhaustion then would kill you.
These are effects in the core rules that would cause one level of exhaustion at a time (see here for effects that can cause more than one level):
Potentially you could gain two levels at the same time, for example at the end of a day of starvation from both food and water, but they would be separate instances. Whichever effect is resolved first would be negated by death ward, the other then would kill you.
P.S. An interesting corner case might be what happens when you are in a form that is immune to exhaustion while suffering the effect. In that case, the effect would not kill you instantly, and death ward would not trigger. Thankfully, you cannot gain exhaustion levels in such a form, so we do not need to worry what happens if the form drops off while you have six levels and you are under death ward.