The Blues' Achilles heel earlier in the season had been their away form and they arrived in Wales having won just three of their nine Barclays Premier League matches away from the Etihad Stadium.
But goals from Fernandinho, Yaya Toure and Aleksandar Kolarov proved enough for a win which keeps City one point behind the Gunners at the top.
A delighted Pellegrini said: "That character is very important because at the beginning of the season we dropped too many points away.
"I think it's not good for this team to win just 11 points out of 27 in the first half of the season.
"Winning here, the first game away (in the new year), is very important for us.
"I think the key to the better away form was to continue playing exactly the same way we did at the beginning; we didn't lose the games against Cardiff and Aston Villa because we didn't play well. We made a lot of mistakes and conceded easy goals."
Wilfried Bony netted Swansea's goals and their manager Michael Laudrup hopes the Ivorian's all-round performance is a sign that he is ready to light up the league during the second half of the season.
Bony had not scored since November 10, but managed two excellent goals against City, heading home a Jonathan de Guzman cross for his first before beating Joe Hart with a fierce low drive.
The goals took Bony's tally since his £12million move from Vitesse Arnhem to 12 for the season, with six having come in the top flight.
Swansea boss Laudrup said: "I think it was by far the best performance from Bony as a Swansea player and that is how we want to see him.
"He showed good movement, he was challenging defenders and if he can do it against Vincent Kompany and Matija Nastasic he can do it against anyone. I think that was very positive."
At full-time Bony revealed a t-shirt with the words 'RIP Anouk' on the front, and the Ivorian explained he had been paying tribute to a friend who had died from cancer.
He said: "I lost a friend, she had cancer and died the other week in Holland. She died just before the Aston Villa game but I did not score, today I got two so I dedicated my goals to her."
Laudrup also hopes the hamstring injury suffered by Pablo Hernandez in the first half will not prove too serious.
The injury-hit Spaniard limped off in the eighth minute, but the Swansea boss feels it is too early to say how long he will be absent for.
He said: "I don't really know how bad it is, when I first saw it I thought it was one of those hamstring problems that can keep you out for four or five weeks.
"But the doctors said it may not be bad and maybe it might be like Bony's injury against Valencia, where we thought it would be serious but he was out for two weeks."