The League Cup third round draw set up Kilmarnock manager Locke to face Hearts for the first time since the Tynecastle club dispensed with his services last year.
With no wins and just two points from their first five Premiership games so far, Kilmarnock have endured a tough start to the campaign which has placed pressure on Locke.
That has come as a surprise to McGhee, who made his first-team breakthrough at Hearts as a 16-year-old under Locke, but he is determined to inflict another defeat on him in next month’s tie at Rugby Park.
“I played under Gary for a couple of years at Hearts. He gave me my first chance in the first team,” said McGhee. “He gave me my debut, bled me into the first team and I’m really grateful for that. I’m a bit surprised Killie have started so poorly, because Gary brought in a lot of good players this summer, experienced lads like Kris Boyd, Stevie Smith and the former Hearts lads.
“It will be nice to catch up with a few former team-mates at Killie, like Jamie MacDonald and Jamie Hamill, but once the game starts it will be full concentration on trying to win it.
“We can’t think about the pressure Gary has been under. It’s a cup tie we want to win. They are all tough in this competition. We have already found that out against Arbroath and Forfar.”
Those ties against lower division opponents are the only ones McGhee has started for Hearts this season. The 19-year-old has had to settle for three substitute outings in the Premiership as he faces fresh competition for a place in the back four from new signings Igor Rossi, Blazej Augustyn and Juwon Oshaniwa.
But despite interest in him from Ipswich Town, who had a bid of £250,000 turned down by Hearts earlier this month, McGhee is happy to try to reclaim a starting place in Robbie Neilson’s side.
“I’m a Hearts player at the moment,” said McGhee. “I’m just trying to keep my head down and get back into the team.
“Robbie has brought in some really good signings, after Danny Wilson and Brad McKay left. He’s brought in experienced heads and it’s just down to me to try and get back in the team. Once I get the opportunity, I’m sure I can take it.”
McGhee may have to be patient, with Hearts having won their first five games back in the top flight to lead the Premiership table.
“The start to the season has exceeded our expectations a little bit,” he added. “We always back ourselves to do reasonably well but it’s been a great start. It’s early days, though, and we can’t afford to get carried away.
“Robbie is great. He has regular meetings with the boys, telling us what we are doing right and doing wrong and keeping us grounded. His coaches Stevie Crawford and Jack Ross are the same. They are great guys to have around and have behind you.
“We are getting great backing from the fans at every home game. It really is like an extra man for the boys on the pitch.
“It’s hard to say if it’s the strongest squad we’ve had in my time at the club. It’s only five games into the league season. But it’s been a great start and the morale is brilliant. The Premiership is far more physical. We need to try and get more experience of handling it.
“The cups are also important to us this season. Last season was disappointing, we got knocked out early in both cups by Celtic. So we need to try and make up for it this year.”