Вы можете увидеть следующий JSFiddle:
https://jsfiddle.net/inussaha/otuz1y5h/10/
нажмите на карту, вы увидите, что всплывающее окно будет удалено.
Popupкласс расширяет google.maps.OverlayView. поэтому у вас есть все функции, унаследованные от Popup.
см. следующий код для добавления / удаления Popup
popup.setMap(null); //this will remove the popup overlay;
//the following will show the popup overlay. (map must be a valid google map object)
popup.setMap(map);
                поэтому ваш код должен выглядеть следующим образом:
var icon1 = "imageA.png";
var icon2 = "imageB.png";
var popup = null;
var marker = new google.maps.Marker({
    position: myLatLng,
    map: map,
    icon: icon1,
    title: "some marker"
});
google.maps.event.addListener(marker, 'mouseover', function() {
    popup = new Popup(
          new google.maps.LatLng(-33.866, 151.196),
          document.getElementById('content'));
    popup.setMap(map); // show the popup
    marker.setIcon(icon2);
});
google.maps.event.addListener(marker, 'mouseout', function() {
    popup.setMap(null); // close the popup
});