After checking this GCP doc, you can see that you'll be able to set a custom port by adding a flag called --ssh-flag
.
For example:
gcloud compute ssh example-instance --zone=us-central1-a --project=project-id --ssh-flag="-p 8000"
It is also applicable for gcloud beta
:
gcloud beta compute ssh example-instance --zone=us-central1-a --project=project-id --ssh-flag="-p 8000"
The sample commands will SSH to your Compute Engine instance on port 8000.
Note: Before connecting, make sure you have an ingress Firewall Rule that accepts TCP on the port you've chosen.
UPDATE: If above is not working and you are getting connection refused, it means you need to configure your VM to listen to the port you wanted. Here are the steps:
Go to sshd configuration file : sudo vi /etc/ssh/sshd_config
Add your chosen port for example:

Save the file.
Restart sshd service : sudo systemctl reload sshd.service