Actually English fits this same pattern! Though some of our names come from Norse gods that got conflated with the Roman gods, because things were a bit messy when the Romans came into contact with the Germanic peoples. Wednesday is from Woden (another name for Odin), who got mixed up with the god Mercury. Tuesday is from Tiw (another name for Tyr), who corresponds to Mars. Thursday is from Thor, who corresponds to Jupiter. And Friday is from Frigg, who corresponds to Venus. Only Saturday still comes from Saturn (and in Japanese, 土曜日 comes from 土星). Monday and Sunday come from the moon and sun for both English and Japanese!
But yeah, all of those languages mentioned have a seven day week that originally came from the Romans, which is why they’re all so similar. Wikipedia has a long article about this.
I never thought that having a knowledge of Greek/Roman and Norse mythology would help me with a basic facet of Japanese, haha, but here we are!