Typically you'd only call animals you have a personal connection to "he" or "she", so in you're example you'd probably call your neighbour's cat "it". It's not wrong to say "she" though.
It's not a matter of what's right and wrong, but what sounds right.It's never wrong to call a pet of yours "it", although it sounds cold and impersonal. It's also never wrong to call an animal "he" or "she" as long as you know its gender. Wildlife documentaries call animals "he" and "she" all the time so the viewer knows the animal's gender, but typically you should default to "it" when talking about animals.