Hamilton claimed their first win in 12 games to send Hearts to the foot of the Ladbrokes Premiership table.
Hearts got one back through Olly Bozanic but could not find an equaliser in the closing stages.
Stendel made five changes from the Hearts team that lost to Celtic in midweek. Out went Christophe Berra, Jamie Brandon, Bozanic, Craig Wighton and Jake Mulraney, replaced by Aidy White, Steven Naismith, Uche Ikpeazu, Sean Clare and Glenn Whelan.
Hearts were the first to threaten, a long-range effort from Michael Smith drifting over the crossbar.
Clare then had a shot blocked by Sam Stubbs with Naismith unable to turn in the rebound. The best chance of the early stages, however, fell to the home team.
The same pair combined five minutes later for the game's first effort on goal, the forward controlling the ball on his chest before getting in a shot that was well parried by Joel Pereira.
Craig Halkett was next to threaten for the visitors but could not keep his header from a corner under the bar.
Naismith then spurned a great chance, volleying over under pressure after being teed up by Steven MacLean's header.
The best opportunity of the first half, though, came in the final minute. Ikpeazu's cross found Halkett in space but his header struck the crossbar.
Naismith did not reappear for the second half, with Mulraney sent on to replace him. But it was Accies who made the breakthrough after 64 minutes.
Scott Martin knocked the ball forward to Oakley who played a first-time pass to Miller who curled an effort into the top corner.
It got worse for Hearts after 73 minutes when Accies doubled their lead. Miller dug out a cross from close to the corner flag, Collar was unmarked to collect it and was able to squeeze his shot past Pereira at the near post.
Substitute Bozanic closed the gap with a header from Smith's corner eight minutes from time but Accies held on for a vital win.