The “kiss of life” is a means of resuscitation in cases of heart failure and stoppage of breath for any reason. Such a method requires breathing air into the victim’s mouth. Therefore, it is impermissible unless necessary, whether the rescuer and the victim are of the same sex or not. Accordingly, it is permissible for a man to give a female victim mouth-to-mouth resuscitation only if there is not qualified female there to rescue her; otherwise it is impermissible.
Dr. Ahmad Muhammad Kan`an, the Head of the Infectious Diseases Department affiliated to the Primary Medical Care Administration in the Eastern Region in Saudi Arabia, stated in The Juristic Medical Encyclopedia:

The kiss of life, or mouth-to-mouth resuscitation, is in fact different from romantic kissing, but it is an innovated medical method of first aid used for rescuing those suffering from heart failure or breath stoppage for any reason. The kiss of life is given by taking a deep breath to fill one’s lungs, fixing one’s mouth tightly on that of the victim and blowing into his/her mouth while holding the victim’s nose and pressing his/her chest. The whole process is repeated until the victim starts breathing again, Allah willing.
The kiss of life is legally permissible because it is a means of resuscitation, if Allah wills. Yet, it goes without saying that it is impermissible unless necessary. So, if it is certain that the victim has already died, mouth-to-mouth resuscitation becomes impermissible, for there is no necessity in such a case.
On the other hand, the rescuer should observe the known medical ethics and rules while giving the kiss of life. Thus, the rescuer should give it with neither lust nor p
leasure, bearing in mind, while trying to rescue a human’s life, the statement of Almighty Allah when He says: “who saveth the life of one, it shall be as if he had saved the life of all mankind” (Al-Ma’idah: 32).