The spaceship bonus item in Pac-Man is taken from Namco's Galaxian. In the game's bonus-item sequence, the object is commonly identified as the Galaxian flagship, a small spacecraft that awards 2,000 points when it appears on the ninth and tenth rounds.
Galaxian was released in 1979, one year before Pac-Man, and was Namco's first major arcade hit. It is a fixed-shooter in which the player controls the Galaxip and battles formations of alien attackers. Its colorful starfield and spacecraft imagery made it a natural visual reference for a bonus symbol in Pac-Man's otherwise food-themed sequence.
The item is sometimes casually called “Galaxian” rather than a flagship, and that shorthand is accepted in quiz contexts. It is not from Asteroids, Defender, or Space Invaders: those were different companies' space-themed arcade games. Galaxian was specifically a Namco property, linking Pac-Man's bonus round to another important game from the company's early arcade history.