Hamill scored from the penalty spot in the 65th minute and Carrick wrapped up the win deep into injury time.
However, Hamill's strike from 12 yards was to be the midfielder's last involvement in the match after he needlessly collected a second booking moments later for his part in a touchline melee.
The player refused to give the ball back as he celebrated and even knocked over County manager Derek Adams.
Relegated Hearts savoured a priceless victory off the park in Lithuania on Wednesday when they took a massive step towards exiting administration.
The players then sent the home support away happy with a win over County.
News in midweek that the club's future had been all but secured meant the home supporters were in good spirits, and those same fans saw their team go close to breaking the deadlock after seven minutes.
Sam Nicholson found Ryan Stevenson on the corner of the box and the striker's curling effort flew just over the bar.
Hearts created the next chance too, but Stevenson could not get himself in a good position to get a shot away after being found by the selfless Billy King.
County keeper Mark Brown had to be alert to rush from his goal and clear the ball after Carrick attempted to race on to a King pass.
The visitors kept the ball well at times but lacked any invention in the final third.
Staggies midfielder Michael Tidser dragged a left-footed half-volley harmlessly wide of Jamie MacDonald's goal from the edge of the area.
Filip Kiss then had an effort that looped just over the bar despite knowing nothing about it, after Hearts winger Sam Nicholson's clearance from Richard Brittain's corner cannoned off the Hungarian in a congested box.
In what was a lacklustre first-half showing, Kiss then had a shot straight at MacDonald saved before Hearts forward Stevenson rifled an effort over from distance.
Hearts had a great opportunity go ahead four minutes after the restart but defender Brad McKay appeared to completely miss the ball in his attempt to head a Kevin McHattie free-kick in from close range.
Hearts midfielder Hamill then picked up a yellow card for felling Michael Tidser in a central position 25 yards from goal.
County captain Richard Brittain took the free-kick but swung his effort comfortably into the arms of MacDonald.
Hearts created the best chance of the game when Nicholson found space inside the box after exchanging passes with King but the winger's effort was blocked by Yann Songo'o.
Following a relatively tame opening hour, the game burst into life in the 65th minute when Hamill scored from the penalty spot and was shown a second yellow card seconds later.
The midfielder converted from 12 yards after McHattie was brought down by Graham Carey.
A melee involving players from both sides ensued as Hamill provoked the County team's ire by refusing to give the ball back. Songo'o led the complaints with Hamill, who then barged visiting manager Adams over in the technical area.
As a result, referee Willie Collum showed Hamill a second booking and also cautioned Songo'o.
Brittain came close to bringing County level but his left-footed shot on the bounce flew just over the bar from 18 yards.
Hearts substitute Scott Robinson then had a shot blocked by Songo'o after being found in the box by Carrick.
County piled on the pressure but Jordan Slew could only head over with a good chance from close range.
And Hearts wrapped up the win deep into injury time when Robinson fed the unmarked Carrick inside the box and the forward lifted a shot high into the net.