Yates (Orica-Scott) easily held off Australian Porte (BMC) as both clocked the same time for the 163km stage from Domdidier to Leysin ski station.
“On the final climb I knew Richie was coming across, so I didn’t want to keep pushing as I knew that when he caught me I would be empty, so I took a bit easy and waited for him to get to me,” Yates said.
“I managed to get him in front into the final kilometre and I think that really saved me as the wind was quite strong in the finish. I am just really happy that I was able to come around him and take the victory.”
Yates will take a 19-second lead on Porte to start Sunday's 18km time trial in Lausanne that ends the six-day race.
“I am in the race lead now and tomorrow we have the time trial, ”Yates said. “Time trialling is not really my speciality but of course I will give it my maximum and try to hold on to the lead.”
Emanuel Buchmann (BORA-hansgrohe) placed third, 20 seconds back, and was third overall, trailing Yates by 38 seconds.
Porte too will be looking forward to the technical city-based time trial, one which he said suited his strengths.
"Tomorrow we have a good time trial, and we will see how that goes," he said. "We didn't come here to finish second, but we will just have to see what happens. Simon Yates (Orica-Scott) is obviously climbing well, but it's also a great time trial for me. It's going to be hard, but I'm ready for that."