A gyroscope seemingly defies gravity because of its behavior. But they don't really defy gravity. A gyroscope that is moving slowly around a pedestal has the same appearance as something that is not adhering to the properties of gravity, but in actuality, it is not contradicting it at all.
The large spinning mass is obeying Newton's law, actually. The magnetic force is reacing to the pull of gravity but in a rather unique way. This device is set up to work on the pull of gravity from its axis which makes it vital for navigation where gravity can be complicated. On a ship, waves make complications but a gyroscope is steady and accurate, no matter what. The same is true in space.