For Brownlee, it was finally gold at his third Olympics having won bronze at London 2012 and then silver behind brother Alistair, who failed to make the Tokyo team, in Rio.
Yee had taken over from individual silver medallist Georgia Taylor-Brown on the last leg but a blistering swim and strong start to the bike leg by Luis closed the gap.
Luis was in danger of pulling away on two wheels but Yee held on to leave them level pegging at the end of the cycle. But Lee had a staggeringly good transition, got straight into his running stride to pull clear of Luis for a gold to add to his silver earlier in the week.
Jess Learmonth, who admitted afterwards she had felt the nerves as the only non-Olympic medallist in the team, had given the quartet the best possible start to the race when she crossed the line in front.
Her swimming has always been her forte, often let down by the running leg, but she matched American Katie Zaferes at the end of leg one. So much had she invested in that two-kilometre run, she had to be taken away in a wheelchair.
Leg two for Jonny Brownlee was less dramatic but no less impressive as he battled for the lead with the US, Netherlands and Germany.
Taylor-Brown had suffered a puncture in the individual event but managed to stay in the saddle for silver. There were no such issues as she handed over to Yee with a 20-second-plus advantage on the last leg.
Yee’s fellow teammates and British support staff looked on nervously for the final section but they needn’t have worried as he produced a run far more mature than his 23 years would suggest.
So much had Luis invested in his bid for gold that he faded dramatically in the final metres to lose out on silver to the US.
Afterwards, Brownlee said of completing the set of Olympic medals: “Olympics, I’ve completed it. I’ve been waiting for that one. Feels amazing. Third Olympics and to finally walk away with a lot of gold. There was a lot of pressure on us. Alex kept his cool and his head.”