"ez" = this, "az" = that but the first "az" means "the" there, the second "az" means "that. Phew! That's confusing! :D
So I read this use of "ez" as emphasis. I put "This apple, not that one." A response to, say, something like "Was this the apple you wanted?" "EZ az alma?" Is that not also an appropriate interpretation of "ez" in a sentence like this?
Looking at it without context "Ez az alma, nem az" could mean "This apple, not that one." However, I'm struggling to come up with a context where it would used in this exact form, with this meaning.
"Az az alma az, amit akartál?" (Is that apple the one you wanted?) "Ez az alma az, nem az." (This apple is it, not that one.)
"Ezt az almát akartad?" (Did you want this apple?) "Ezt az almát (akartam), nem azt." ((I wanted) this apple, not that one.)