You have to settle the remaining principal of the car loan first, then sell the car. What ever difference between the principal amount and the selling price will be used as DP for the new car.
This is what Ford Alabang told me when I asked about trading in my Fiesta Ecoboost for a Focus Ecoboost. They have a partner buy&sell trader who will be the one to buy the car.