HI, WELCOME TO FISHLORE!
You are very right! 5 Nitrite can kill your fish.....first thing to do is a 50% water change right away, be sure to use conditioner like Prime when you do the change....It sounds like your tank isn't all through the cycle yet, so you will need to do a 50% change every day until the nitrite comes down....when it reaches 1 or 2 that could be decreased to 25% changes.
Once your ammonia and nitrite drop to 0 then you just have to maintain your tank with water changes to keep the nitrates below 20 and your fish should be fine....
I also agree the goldfish needs a different tank, it is never a good idea to keep tropicals in with cool water fish...both are more prone to sickness.
Good Luck