Knowing which way is north and south is different from being able to visually see it. It's likely that you knew which way is north and south without realising it. Even if you were very good at tricking yourself, you may have got it right just by chance.
I seem to have a very good intuitive sense of direction. When I lived in Ottawa, though, I used to always get lost when I hit the river. It took me years to figure out what the problem was. The river runs roughly east west and so all the signs say "East" or "West", but it's actually in the shape of a V. Most of the time it's running NW/SE or NE/SW. Every time I hit the river, I'd consciously think that I'm going East/West when in reality I was going in a completely different direction. It really threw me off.
I think people are more attuned to direction than they think. Direction of the sun, time of day, landmarks, direction of shadows, position of moss on trees, etc, etc. After years and years of seeing it, your brain get's pretty good at orienting you -- even if you don't consciously understand it. These days, I try not to reason about my orientation, but rather guess. I tend to have better results.