The incident, which happened just after half an hour of the goalless draw at Links Park, went unpunished during the match.
However, after studying TV evidence, SFA compliance officer Vincent Lunny issued Hegarty with a notice of complaint, four days after the match.
Rangers, who secured the division three title with the point on Saturday, reviewed the incident and decided to accept the suspension for the 20-year-old.
The Northern Ireland U21 international will now miss the matches against Queen's Park at Hampden on Saturday and the home fixture against Clyde on 13 April.
But he will be available to play for Rangers in the friendly match against Irish League Linfield at Ibrox three days earlier.
Hegarty, a regular fixture in manager Ally McCoist's side, has made 27 appearances for the runaway champions this season.
Hegarty told the Rangers website: "It's a bit frustrating because it wasn't malicious in any way and I forgot all about it after the game.
"It's one that I just have to deal with, but it wasn't malicious in any way and I didn't mean to hurt him. I like a tackle but I wouldn't go out to hurt another pro.
"The timing isn't great, because I've been enjoying playing a lot of games and we've had a couple of clean sheets and started to look solid at the back.
"It's disappointing to come out of the team but, hopefully, after the two weeks I'll come back and be fighting fit to finish off the season.
"I don't like sitting watching because I'm sitting thinking I wish I could play, so it will be frustrating, but I'll back the boys 110 per cent."