McCarthy netted with a spectacular bicycle kick in a 1-0 success at Orlando Stadium on Sunday.
And Bafana Bafana's record scorer says that one was for Madiba, who was discharged from hospital on the same day after undergoing a diagnostic procedure for a longstanding abdominal complaint.
McCarthy said: "I send my regards to my granddad Madiba - that was my inspiration. I promised I would score for the ex-president - that goal I dedicate specially for him."
The 34-year-old says he often used to throw himself around in his younger days at Ajax Amsterdam and Celta Vigo.
"It's something I've been very good at - something I used to do a lot at Celta Vigo and at Ajax Amsterdam," he said.
"But as I got older, I didn't wanna make a fool of myself."
McCarthy added that he was grateful to come on as a 71st-minute substitute, hinting that under-fire coach Julio Leal responded to calls in the stands.
"I thought the coach wasn't gonna put me on. I got the 12th man, they made the decision. We needed that extra little push because everyone seemed to drop points this weekend, so we needed it."
Victory placed Pirates level with second-placed Kaizer Chiefs on 33 points - three behind leaders Sundowns.