When entering a city, by pressing your own inventory marker at the bottom left. You will be able to see the cities inventory as well (Not a city owned by the player) You can promptly withdraw any item you see without being charged, then you can resell any of those weapons back to the city.