You can't hide the engines
If we're assuming hard science no-magic-warp engines and ships that go places in years, not millenia, then the most visible part of any ship is going to be it's exhaust. In most natural planetary environments, there is nothing that could be confused with it. Some answers here are arguing that you might make a ship so "quiet" that can be confused with an asteroid - but that can be done only while not maneuvering at all.
Even our current technology allows us to make an exhaustive list of any ships firing their engines in our closest star systems - I mean, there aren't any; but if someone used any engine capable of moving a sizeable ship (as per the requirement of some people inside, not a tiny probe; plus a capability for maneuver not the current practice of a single burn and airbrake because we don't have enough fuel to stop) in story-meaningful time - say, no more than a few months for interplanetary distances or less than a century for interstellar distances - then we already would know it.
If you're seen, we know that you're not natural
We can't do it yet, but there should be no issues for a spacefaring civilization to have a detailed list of every asteroid of significant size (say, ship-size) in their planetary systems, in the same manner that we currently track every baseball-sized piece of junk in earth orbit. Yes, there are many of them, that's why we have computers. We don't frequently get any new asteroids, and when we do, we can observe the collision that made it. 199
If a ship that's otherwise indistinguishable from an asteroid arrived in some soft-science way, say, from hyperspace - then we'd still could get an immediate and automated warning from passive sensors that hey, we have a new asteroid that wasn't there yesterday.
Once you are detected, you stay detected forever
Let's assume that some pirate successfully robs a ship, gets some loot, starts running away and has the quietest most hidden ship possible. Well, we still know where exactly it is, and and rather accurately where it will be in next month or next year. The only thing that a perfectly stealthy ship can do is float in a straight line, and the moment it wants to adjust it's course, then once again everyone will know where exactly it is and where it's going to now.
This also means that "You never know when space pirates are going to strike" is not really true - every space station would have an exhaustive list of every ship that is currently on route "nearby" (for very, very large values of "nearby" - passive detection of engines would work at longer ranges than ships with those engines will fly in a lifetime) as well as their exact routes, since you don't need their cooperation to obtain that, you just need to look. If you don't want to fly past anyone, then you don't. If someone fires up their engines to intercept you, then you notice that well in advance, and everyone else does as well, and is able to track the other ship to wherever it goes to. 500