After netting, both players put their open hands together with their thumbs locked and fingers outstretched in what appeared to symbolise the eagle on the Albanian flag.
Shaqiri was born in Kosovo, the former Serbian province that declared independence in 2008, while Xhaka's parents are originally from Kosovo and of Albanian heritage.
Serbia does not recognize Kosovo's independence and relations between the two countries remain tense, though Serbian players did not react to the gestures during the game.
"I think about this, I don't want to speak," Shaqiri, who also took off his shirt after scoring, told reporters at full time. "In football, you have always emotions.
"You can see what I did, and it's just emotion, and I'm just happy to have scored the goal. I did it, and we don't have to speak about this."
The result moves Switzerland to four points in Group E, level with Brazil, while Serbia are one point behind.