You need to add a relatively tall climbing tree (the number one answer to almost anything related to cats) or similar high-up vantage point near the window and instead of closing the curtains I'd let a view to the outside from this tree. Closing the curtains forces your cat to go on the windowsill where s/he is then suddenly too close to the passerby. Having the window glass between them makes no difference, as you've noticed.
Provide your cat with the high-up observation platform with a good view to keep watch over the "intruder" while the cat itself can stay invisible (or at least feel like invisible). How this might work depends a lot on the reason what really upsets your cat in the first place. Usually it is the close proximity to the passerby, which is quite unavoidable if the cat sits on a windowsill and the intruder moves right under your cat's nose. Stealth is life!
What changes between night and day is the lighting. During a day the brightest light comes from outside, which makes it very difficult from the outside to see in. An animal passing the window at daytime can't really see in, so it can't make eye-contact with your cat. Your cat is invisible because of the glass reflection. Night changes this. An animal on the outside can see your cat so close on the windowsill and makes eyecontact.
In case there is an outside lightsource that shines through the window illuminating your cat as well as the outside creature, then a roll-down curtain might help by shadowing your cat out of view. Like this:
Update:
From what I've later understood of the setting, it seems the above pic is not quite what your basement apartment looks like. If I got it right, the relation of ground level to window looks like this:
For the happiness of the cat I would not try to prevent access to the windowsill, as cats seem to like to sit and watch things through a window. I would turn the window into a one-way-mirror to the outside, which adds some darkening effect to the inside. Making it one-way to outside allows you (and your cat) to see out, but from the outside it appears to be a mirror. I don't know what the product is called in English, but it is a thin foil-like adhesive film that is spread on the window glass. Though there's no guarantee that this would work, but at least it would prevent eyecontact between your cat and the by-passing animal, as I believe that is an important part of the problem.
The get a full mirror-effect requires that there's some light on the outside and relatively dark in the room inside.