As far as I remember, you need to make sure the frequent flyer number associated with your Star Alliance Gold status is stored in the booking to receive the benefits. This shouldn't be an issue, though. If you have the booking reference for the Swiss flight, you should be able to update the frequent flyer program and number
online. I believe it can be found in the section where you manage the passenger information.