After inflicting a 10th defeat in 11 Championship games on their hosts, Neil Warnock said: "At 2-1 down I was stood there thinking 'why am I still doing this job at 68?' At 3-2 up I remembered exactly why I am doing it!"
He continued: "It's always special beating Bristol City for me because you have to work hard for anything you get at Ashton Gate.
"The winning goal was a fantastic strike and I haven't run so fast in ages. I'm delighted for our fans, who contributed to a brilliant atmosphere.
"I think we still need five or six players to get to want to be. I am meeting the chairman tonight and hope he will be in a good mood.
"But I am delighted with what the current squad are doing. The players are buying into how I want to play and we are making progress."
The home side went ahead on 51 minutes when Joe Bryan's volley from just outside the box hit the crossbar and went in off the back of diving Cardiff goalkeeper Brian Murphy.
The home side looked comfortable until the 74th minute when Mark Little conceded a penalty by tripping Joe Ralls with the ball heading away from goal. Pilkington drove the spot-kick down the middle to equalise.
Tammy Abraham's 18th goal of the season, an overhead kick from a Milan Djuric knock-down put the home side back in front with 12 minutes remaining.
However, substitute Harris got the better of Bryan at the far post to head a second Cardiff equaliser, before Pilkington found the top corner with a right-foot screamer from 25 yards three minutes later.
Under-fire City head coach Lee Johnson said: "Angry, frustrated and vexed are words that come to mind.
"We have to see that out, but there was a fear to our play and we have lost to a fantastic strike.
"Cardiff did not have to work that hard to win. I haven't seen the penalty incident back, but I had no complaints at the time.
"We have had some excellent individual performances, but as a team we panicked in the closing stages and that is not acceptable.
"The players have to look hard at themselves and the same applies to me. I have faith in my squad and I am sure we will turn things around. But words are cheap.
"There is no one hurting more than me. We work hard every day and we stick together.
"We have scored twice at home again and lost. I have to take that on the chin."