The Algerian winger has been below his dazzling best in the opening few Premier League games of the season but returned to top form with a match-winning double as the Foxes defeated Club Brugge 3-0 in their European top flight debut.
Mahrez had missed three of his past four penalties but opted to take a second-half spot-kick ahead of new signing Islam Slimani and duly converted to wrap up proceedings at the Jan Breydel Stadium in Belgium.
Ranieri joked of his star: "If he doesn't score, I take the neck and I crush the neck.
"He took the responsibility.
"I tried to say Slimani because he is a penalty scorer but he (Mahrez) has the personality to choose. He was a lucky man.
"Maybe the music woke him up. Maybe he is very tired of listening to dilly-ding, dilly-dong and prefers the Champions League music! He was very good."