The match was played in the newly refurbished Khalifa International Stadium, the first 2022 World Cup venue to be completed.
Among those watching on in the 40,000-seater air-conditioned stadium was FIFA president Gianni Infantino.
Xavi provided the assist for Jugurtha Hamroun to fire home the winner in injury time, to cap a 2-1 victory for Al Sadd against rivals Al Rayyan, coached by another former Barcelona great, Michael Laudrup.
Al Rayyan had taken the lead early in the second half when skipper Rodrigo Tabata scored in the 49th minute.
But just seven minutes later, Al Sadd's Hassan Al-Haydous scored from the spot to equalise and set up the thrilling finale.
As much as the game, the biggest star of the night was the stadium itself.
Khalifa is the first World Cup venue to be completed, five years ahead of the tournament, and it will also host the 2019 World Athletics Championship.
Khalifa comes complete with the much-talked-about cooling technology that was central to Qatar's controversial bid for the World Cup.
It was deployed on Friday, keeping fans cool as temperatures reached 35 degrees Celsius (95 degrees Fahrenheit) before kick-off.
The stadium was officially inaugurated by Qatar's leader, Emir Sheikh Tamim bin Hamad Al-Thani before the match.
"In the name of all Arabs, I announce the readiness of Khalifa Stadium for hosting games at the 2022 World Cup," he told the crowd.
It was Al Sadd's second domestic cup win of the season having won the Qatar Cup last month.
It is the 16th time they have won the Emir Cup, a national record.
Xavi became the first skipper to lift a trophy at Khalifa since 2014, before the stadium was closed for refurbishment.
Three years ago Al Sadd again won the Emir Cup and their skipper that day was another Spanish great, former Real Madrid star, Raul.