The Tunisian opened the scoring on Sunday and provided the assist for the second to help the visitors make it 10 straight wins in all competitions.
However, Ayr managed to keep the Ibrox side at arm's length for the opening 45 minutes before Mohsni broke the deadlock early in the second half.
With 55 minutes on the clock, the Light Blues went ahead when Ian Black's free-kick was chested down by Andy Little and Mohsni's turn and fierce strike from inside the box left keeper David Hutton with no chance.
And two minutes later, following Arnold Peralta's corner, the former Ipswich and Southend defender headed the ball into the path of Lewis MacLeod whose spectacular overhead kick from five yards flew high into the net.
Lee Wallace and David Templeton missed good chances to add a third as the Gers ran out comfortable winners, having only conceded a single league goal since August 10.
However, it was the hosts who had started the stronger and came mighty close to taking the lead in the fifth minute when Michael Donald's hooked shot, from a Mark Roberts cross, struck the right-hand post with keeper Cammy Bell beaten.
And Bell was called into action to push away Scott McLaughlin's curling free-kick after 18 minutes.
Much of the first 45 minutes was limited to long range efforts from both sides, although Rangers should have taken the lead on the stroke of half-time when an unmarked Jon Daly, and with only the keeper to beat, scooped the ball wide from inside the six-yard box.
All that changed after the break as Rangers took control and the Glasgow giants remain on course to reach the second tier of Scottish football next season.