Barrett linked well with Leeds star Keane as McCarthy's team warmed up for their European Championship test in Moscow next month in some style.
He said Keane tipped him off about his goal. "Robbie was just brilliant to play with," added Barrett. "He told me not to be nervous when I came on and just a minute or so before I scored he told me I would get a goal.
"I could have had two. I missed a chance a few minutes later and it was easier if anything. But I will learn from that and from this experience.
"These are world class players playing for Ireland now and I can't believe that I have just played alongside the guys I watched on television in Dublin during the World Cup finals. This is all a dream."
McCarthy won't make Barrett any promises about the future but he was as delighted as anyone for the youngster whose father Gary played League of Ireland football with Shamrock Rovers. "My assistant Ian Evans has been raving about Graham since he was 16," said McCarthy. "He liked the look of him then because he is a natural centre-forward who knows how to put the ball in the net. We have kept an eye on him and I was aware of his health problems but he really looked the business on Tuesday and I asked Don Givens to take him off at half-time and let me have him for the seniors."
McCarthy's team picked up from their World Cup disappointment against Spain with an emphatic win but the manager knows the real test is around the corner. "This will count for nothing when we go to Moscow in a few week's time," he added. "That is where the pressure comes back on and my backside goes into the bacon slicer again."
Tottenham's Gary Doherty was one of six half-time substitutes introduced by McCarthy, operating as both a centre-back and a centre-forward.
"I am just glad to get back in the squad and pick up from last season," said Doherty. "The next thing is to get back into the team at club level and then I will try to make the squad for Moscow."