$399 would've been the subsidized AT&T contract price. If you are willing to lock into a carrier today, you can get brand new iPhones for "free" or practically "free" with 24-36 month bill credits (essentially contracts).
The non-contract retail price for a 64GB iPhone 5 back then was a lot higher at $849. Adjusting for inflation (from time of iPhone 5 launch), $849 would be around $1,225 today.