I'd use "primeiro nível" (first level) instead of "nível superior" (ancestor level) here.
Since in portuguese we do not have top level as a possible translation, first level is the one that mostly adhere to the context here.