McKee struck early on to give David Healy's side the win in Marbella as part of their preparations for their forthcoming Champions League qualifier against The New Saints.
The Qatar national team are of course preparing for the upcoming World Cup finals which they will host in November.
This is not the first time Linfield have played against a national team.
In the 1980s Roy Coyle's side faced both Argentina and Kenya at Windsor Park.
The Blues return to Northern Ireland on Wednesday after an intensive week long training camp in Southern Spain, in preparation for the upcoming European tie against their Welsh opponents.