The city will be contested when the delivery occurs. the fight is resolved after the delivery but before the income for the delivery is resolved. I would definitely rule that if you own the city after the fight is resolved that you don't have to pay the commission.
I agree with this and above post that not paying the commission makes sense. Thematically why would you pay a tax to a city you've conquered. It's just the timing in the rules that niggles here. Also if a player receives money from another player delivering goods does that could to there income?