Maybe you could try to give him some other form of entertainment, a lot of people provide ping pong balls, betta logs, and "mirror time" as entertainment!
Try floating a ping pong ball on the water surface, some fish like to push it around the tank! Also try holding a mirror outside of his tank for a few minutes a day so that he can work out some aggression on his reflection. Floating betta logs also make great toys, a lot of fish like to swim through them or hide in them.
Live plants might help as well, my fish was bored all the time when I had plastic plants. Now that I have live plants he no longer stares at me vacantly out of boredom and now rubs against their leaves and builds bubble nests!
He doesn't really have much to do in a tank that size, and is probably bored and naturally aggressive. So even if he does just see a shadow on the other side, he'll probably keep going at it if he doesn't have anything else to do. I don't know if they can smell each other, but I haven't heard of anyone else having that problem.
I'd say that boredom and lack of swimming space is the issue here :/