I absolutely understand your problem, as I think all of my weight gain happened due to eating in the late afternoon and evenings. I would get home from work and then "relax" while snacking until dinner, then have big dinner and keep munching.
What I now do is - have a big lunch. When I get home - I get busy. Either go to the gym, vacuum the house, wash the car, iron, run errands - anything to get away from the fridge.
I have a small snack - like 10 almonds, or a bit of cottage cheese.
For dinner I have a bowl of clear soup and some nice salad.
But I have shifted the majority of caloric entry towards the breakfast and lunch.
The thing with getting hungry after 5 pm for me was that it was not hunger that I could satisfy with food. The more I ate, the more I wanted to eat. It was a combination of being tired, not knowing how to relax, boredom, etc. So I stopped trying to satisfy myself with food. I go take a shower, paint my nails, declutter a drawer, read a book, call a friend, garden. When I looked at it - there are so many other things I could do. Why would food and eating be the only activity around that time of day?
Also, when I eat too much around that time - it almost means an end to my day as I am too sluggish to do anything else with full belly. So it was also an incentive to me to eat a small snack and/or light dinner, as I then still have energy to do other things.
I don't know if this helps you, but keep asking questions until you find a solution that works for you. Good luck!
If it is important to you, you will find a way. If not, you will find an excuse.