Profits after costs from the friendly will go to the cash-strapped Glasgow club, who are currently in administration.
Rangers boss Ally McCoist said: “The Rangers supporters have been magnificent in the past few months and our fans in Northern Ireland will be rewarded with a game at Windsor Park that will also help the club in difficult times.
“We always enjoy great support from Belfast and we look forward to playing there once again next month.
“On behalf of everyone at Rangers, I would also like to thank Linfield for supporting us by agreeing to take part in this match.”
Skipper Steven Davis added: “It is an honour and privilege to be captain of Rangers and Northern Ireland so it will be nice to return to Windsor Park on club business.
“We have received unbelievable support from fans worldwide in recent months which we all appreciate and the players are all looking forward to returning to Belfast on May 7.”
Linfield Chairman Jim Kerr said: “Linfield Football Club has had a long cordial relationship with Rangers Football Club and is delighted to assist during this difficult time.
“We hope that all Linfield and Rangers fans in Northern Ireland and from further afield will show their support.”