I would be more inclined to use 'evening' for 5pm, but I wouldn't argue with someone if they called it afternoon.
My own person use would be:
12pm - 4/5pm - afternoon
5pm - 9pm evening
9pm onwards - night.
I assume it differs for different people. So, you can use both afternoon and evening for 5pm, yes.