Yeah, because technically Z-Order sorting is just the draw order. If you're looking at the monitor it kinda looks like this, layer-wise.
Code:
+  |  +  
|  +  |   /|
|     |  / ----+
+  +  |  \ ----+
   |  +   \|
   +
Like the draw order of (top down) terrain, particles/projectiles, enemies/clouds, player... and so on.

Sort by the draw order and the texture name together, prior to drawing. That way you draw all enemies of the same image in the same "layer" all at once, rather than just doing it inefficiently.