Locke and Darren Murray were taking charge of their first game since manager John McGlynn's departure from Tynecastle, but did not get off to the desired start as the hosts fell to a fifth successive league defeat.
A blistering beginning saw the visitors storm two goals up after only eight minutes. Michael Higdon netted his 20th of the season before Dylan McGowan was credited with an own goal.
John Sutton scored for Hearts, but the visitors held on to move three points clear of Inverness.
Locke, who now turns his attention to Tuesday's visit of St Johnstone, said: "I think we can be pretty positive about the second half.
"I've told the players we cannot do that for 45 minutes, we need to do it for 90, especially with the run we're going through. Certainly, the second half was more like the Hearts team we need to see at Tynecastle.
"We had stressed how important it was to come out of the traps and, if you do get off to a good start, the fans get right behind you.
"I was really disappointed at going two down so early. The great thing from my point of view is that it would have been easy for the players to put their head down and not react, but they reacted in the right manner.
"We changed a couple of things at half-time and I've said to them that the second half was the type of performance we're expecting.
"We certainly have to work on one or two things in training but hopefully on Tuesday we can start the game better. If we play for 90 minutes like we did in the second half here, hopefully we can turn the corner."