Lee Ashcroft opened the scoring for Killie but Hamilton hit back through Jason Scotland, Darian MacKinnon and substitute Nigel Hasselbaink.
Substitute Greg Kiltie reduced the deficit in the 77th minute but the 3-2 defeat means ninth-placed Killie, with three fixtures remaining, are above Ross County on goal difference and only six points ahead of relegation play-off candidates Motherwell who they play next Friday night at Fir Park.
“It is massive because of the run we have been on, no doubt about it,” said the Killie boss.
“We are making life really difficult for ourselves.
“We would still rather be in our position, no doubt about that, but we need to make sure we dig out a result because we don’t want to get dragged into the mess at the bottom.
“We started well and got a goal in front and you are hoping that it would give the players confidence.
“But I think we looked a wee bit tentative in the first half.
“I thought we finished the game well and the effort and commitment was there but we have to cut out the silly mistakes because we are getting punished.”
Martin Canning was pleased at the way his Hamilton side responded from the loss of an early goal to record back-to-back victories following 13 games without a win.
The Accies player-manager, who left himself out of the squad despite returning from suspension, said: “Overall we deserved to win. It is a great feeling but I am more pleased for the boys, they have continued to work after a difficult time.
“Performance-wise it had been decent but we haven’t carried the luck but in the last couple of games, we haven’t been lucky but the breaks have been even and we have managed to win both games.
“Coming from behind showed that togetherness and grit and that is one thing we have all got.
“We had a lull but now we want to kick on until the end of the season.”
Both camps played down the incident near the end between Ashcroft and Hasselbaink who squared up after tangling.
It looked as if the Killie player threw a punch at his opponent before he was head-butted but referee Steven McLean opted to only book both players.
Canning said: “I thought it was a foul for Nigel first of all, he was about to run away and the boy has pulled him back.
“There was a wee coming together and to be honest the fourth official crossed my path and I didn’t see what caused all the uproar.”
Locke said: “It was disappointing to see, something out of nothing” while Ashcroft said: “I didn’t feel as I did anything wrong. It was a heated moment but I can’t really remember.”