The Swiss midfielder reacted angrily after being booed by the home fans at the Emirates while being substituted in the 2-2 draw against Crystal Palace.
Having since been left out of the squad, but Vieira, a former skipper for the Gunners, has sympathy for Xhaka.
“I feel sorry for him because he (was) the captain and he’s going through a really difficult period and really difficult time at Arsenal,” Vieira said.
“I think we have to remind ourselves that he’s achieved a lot since he’s at Arsenal and he deserves a lot of respect.
“When you’re a player and don’t perform the way you expect, you get frustrated about yourself. And sometimes you say things or do things you regret.”
Arsenal’s 2-0 loss at Leicester City last weekend left them sixth in the Premier League and put more pressure on coach Unai Emery, who received backing from the club’s hierarchy but has been told to improve results.
Vieira, who won three league titles with Arsenal, has also urged the supporters to get behind their manager.
“I think he has enough experience to get them through this difficult spell,” Vieira added.
“We have to get behind him and give him time to change things. I am not sure a change of manager will fix the problems.”
Reuters also contributed to this report
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies