Gosh is an expression that comes from "God". The americans invented it because they are strong believers, and the Bible says that you should not say the name of God in vain... thats why they deform the name to say it. Its like Jeez, which comes from Jesus. In spanish you have many ways to say the same thing, like "Dios mio", "Vaya", "Wow" o "Cielos".
Hope its clear... if u have more doubts, then write to me.