The Jambos looked to be firmly in control after Ross Callachan’s early strike was followed up by Kyle Lafferty’s penalty midway through the opening period.
But, when Rakish Bingham pulled one back for Accies, Hearts began to unravel and were glad to eventually hear the full-time whistle.
Levein kicked off his second stint as Gorgie boss with a decent 0-0 draw against Aberdeen last week and saw his side get off to the perfect start this time as they grabbed a third-minute opener.
Jamie Walker sent the visitors surging forward as he nutmegged Darian MacKinnon on halfway before sweeping wide to Michael Smith, whose cross was bundled home by Callachan.
They made it two on 23 minutes when Ionnis Skondras’ clumsy barge on Ismael Goncalves left referee Bobby Madden with no choice but to point to the spot. Lafferty’s penalty was both confident and powerful as he rammed past Gary Woods.
It was proving to be an eventful afternoon for Bingham. Having already been barracked by his own supporters for showing a lack of effort, he earned another round of groans when he made a complete mess of a gilt-edged opportunity. With just Jon McLaughlin to beat, he sent his heavy first touch straight off the pitch.
Thankfully for the striker, he did not have to think too much about his next opportunity on 34 minutes.
Rafal Grzelak was caught ball-watching as David Templeton nicked possession. The former Hearts winger scampered into the box before firing a low cross across goal for Bingham to tuck away.
Arnaud Djoum did not know much about his intervention soon after as he kept Hearts in front by blocking Templeton’s overhead hook with his face.
McLaughlin knew just what he was doing as he tipped away a Crawford free-kick on 58 minutes with an impressive fingertip save.
Hearts had let their standards drop in the wake of Lafferty’s goal and Hamilton did their best to capitalise as they swarmed forward.
Walker - who had just been involved in a furious spat with MacKinnon after being accused of diving - was unlucky with a free-kick attempt after being dragged down by Crawford.
But the Jambos had at least re-established a foothold in midfield and went close to making the points safe late on when Lafferty smashed across goal after Smith’s cross found him at the back post.