The first lot came out for the families of Benjamin. So the first tribe that received territory was the tribe of Benjamin. Joshua assigned them land which lay between the tribe of Judah on the south and the descendants of Joseph on the north.
The families of Simeon received their inheritance from Judah’s share of land because Judah’s portion exceeded what they needed. So the inheritance of the families of Simeon was within the territory of Judah.