Jambos captain Lawrence Shankland gave the visitors the lead after five minutes before home skipper James Tavernier smacked the post with a penalty at the end of the first half after Toby Sibbick’s foul on Todd Cantwell.
Gers midfielder Nicolas Raskin was taken from the field on a stretcher after sustaining an injury in shooting after the break but the game ended on a high for the Light Blues, under the tutelage of Clement for the third time.
The hosts were awarded a second spot-kick in the 90th minute for a Peter Haring foul on Connor Goldson after a VAR check by referee John Beaton, and this time Tavernier slammed it in, with substitute Danilo completing the turnaround by heading home the winner in the third of nine added minutes.
“I am curious if there comes a moment, and it always comes, where the scenario is not going our way, how they would react,” Clement said after the match. “Clearly they had the reaction that I wanted.
“Our strength needs to be that whatever happens in football, we never give up and we keep on repeating what we are doing because they are doing already good things together.
“Of course we need to still make better a lot of details but if we show the right mentality over and over again in every action and in the reaction afterwards then we are a really good team.
“That is what we showed together, not with 11 but with the whole squad, also the players who came in to give this energy.”
The Belgian continued: “Was it perfect? No. But for me it is a reference game in the way that they have seen if they never give up a lot of good things can happen.
“It is not a guarantee that you win every game because not even the best teams in the world manage to do that but we are going to win much more games than we have done until now. It is a big step forward for me and in that way Tav was an example today.
“Missing the penalty, getting the stick because of that, that moment you can lose confidence, you can go down, you can stop taking responsibility.
“But he took the second penalty, he scored it and afterwards he gave the assist for the second goal.
“I want to see a lot of players with that mentality in my dressing room.”
Hearts boss Steven Naismith had his own question marks over both penalties.
The former Rangers striker said: “The game hinges on the penalty decision. I don’t think it is a penalty.
“At every corner there was blocking, where Rangers players were not even interested in the ball. All they are doing is looking at our man, blocking our player.
“I spoke to officials during the game who said if that happened and it was given as a goal, it would be given as a foul.
“Lo and behold, at the end of the game there is a clear block on our man.
“John Lundstram is not even interested in the ball.”