John Sutton netted the winner in the fourth minute when he got on the end of an inviting cross from Michael Ngoo.
Locke said: "I thought we were on the front foot for most of the game. Coming to Rugby Park, Kilmarnock will always have a wee spell.
"But we defended really well and for me we thoroughly deserved the three points.
"We knew we could go two points behind Kilmarnock and they are the team we are trying to catch in seventh place."
Locke praised the performance of midfielder Darren Barr, who returned from injury to start two days after being told he would not be offered a new contract.
"Darren is a magnificent professional, everybody knows the financial situation at the club," he said.
"I'm disappointed but I have no qualms putting Darren in.
"I know how good a professional he is and what he contributes to the team and I thought he was magnificent today."