Hearts, also taken to a shoot-out by Raith last time out, again prevailed on penalties after 120 minutes of an enthralling tie finished at 3-3.
Locke said: "Credit to the players, they gave us everything. We could have defended a bit better and there was a bit of naivety but I've got nothing but praise for the boys.
"They worked their socks off and the main thing is we are in the next round. It's all about being in the next round.
"It's not great for the heart going to penalties. But we knew it was going to be a tough game and Queens were a credit to themselves.
"Jim McIntyre has them playing really well."
Queens boss McIntyre had no complaints about his side's performance, adding: "First and foremost there's a lot of pride in the players.
"We went behind three times and kept at it.
"We just needed to be more ruthless because we had some really good opportunities. I thought we were excellent but all credit to Hearts, they were ruthless with their chances.
"When it comes to penalties it's a lottery. It's about holding your nerve and you need a bit of lady luck. It's always been the same."