Mu No Hakugei (The white whale of Mu)
Tokyo Movie Shinsha, 1980
Basically, the story revolves on the fight between the legendary empires of Mu and Atlantis.
The former disappeared beneath the waves, while the latter was banished in a sort of other dimension eouns ago.
Now (well, in 1980) a planetary conjunction paves the way for the return of the evil empire of Atlantis.
The only hope for our planet are five boys, the descendants of Mu, and the White Whale, a spaceship shaped like a whale, where the conscience of the great emperor of Mu resides.
Later in the series the spaceship sheds it's whale-like appearance for its real form, and the setting moves into space for the final attack to Atlantis.
This could be the part you remember.
Pics from the opening: