Aleksandar Mitrovic put Serbia in front with a header in the fifth minute, but Granit Xhaka drew Switzerland level before Shaqiri made sure of all three points late on in Kaliningrad.
Shaqiri, who celebrated his winner by appearing to reference Albania's symbolic double-headed eagle with his hands, was pleased with how Switzerland have developed in the last few years.
"It was a great pass from Mario Gavranovic," Shaqiri told reporters at full time. "I knew I had a good scoring opportunity so I just kept running and used my instinct to put it away.
"I think we've demonstrated today that we're able to rally. These players play for top clubs all over Europe and we were able to turn it around - it's not something we would have been able to do a couple of years ago."
Switzerland are now level with Brazil on four points at the top of Group E, in second place due to an inferior goal difference.