Business & farm

I purchased the car for personal use at about $13k. Later, I placed the car 100% in service to the business (no more personal use) and determined the fair market value was $12k. I began a depreciation schedule at this price. Finally, when the car was totaled, insurance paid $17k. Is this a gain of $5k? $4k? Or something else? I had assumed $5k based on the earlier discussion...