For gift economy to reliably sustain a group in a long term you need a group, that have a capacity to fulfill all its needs inside the group. You also need this group to be small enough for you to remember who you owe and who owes you.
This works to this day if the in-group is small enough (i.e. I'm getting free eggs and cabbage if neighbors produces too much. With the expectation I will drive old lady to a church on rainy Sundays.) Individual small villages worked on gift economies until relatively recently. Really only the need of individuals to have money to acquire the goods coming from OUTSIDE of the group that put a peg in it. But here we are quite beyond even the barter economy.
In the context of 10 000 head city you need to somehow conserve these multi specialization in-groups. In our world (in context of old world at least) we see a trend for these groups to specialize in specific trade. But imagine if all the workshops are organized by the city and only way how to get some goods inside the group is to have a member working there. Or diversification is driven by some cultural incentive. Inside such group (clan) individual households could keep their gift economy going.
Interesting thing can occur when you realize that heads of these 'clans' within the city are their own in-group, that can wield overproduce of their groups as gifts. Ruler of the city and chiefs of nearby villages may be their own in-group who has gift economy going. Same goes for rulers of cities in the wider area.
That said, outside of the most personal, the most basic in-group, gift economy is very fragile. If 'gifts' are expected on regular basis you are coming into an are of tribute or redistributive economy (like what Sumerians had) especially if you put enough bureaucracy into it (like Sumerians did). If expectation of returning the 'gift' becomes explicit you are coming into territory of barter economy (especially if you don't agree how many fish the other guy owes you for your 'gift' of fifty pots).
Long range trade is interesting phenomenon in context of gift as prevalent economic system. We know that such trade existed in Europe long before 10 000 - 15 000 inhabitant cities were a thing there - good quality flint and even fancier stuff like amber was traded all over the place. But it is also not idea that much removed from gift economy. Imagine a guy, who is not a part of any group you know of, coming to your village, who is wiling to give you a 'gift' of fancy flint, but only after you come up with 'gift' some old dusty furs you don't need anyway. After all he don't know when and if he will be come back. This is clearly barter, but looking enough like gift to not freak out cultural sensibilities.
So! How to intersect gift and commodity economies in ancient civilizations?
Have reasonably sized in-groups who retains gift economy within, but engage in commodity based trade without. The more the in-groups interest is distanced from basic individual-to-individual interaction, the more likely it is for the economic relation to evolve into adjacent system (barter, tribute, redistributive) which is more robust in the face of scarcity (in context of bigger populations).