You need to disable the default info window creation and handle the infowindow yourself in code. Here's an example:
var CommonInfoWindow = new google.maps.InfoWindow({"maxWidth": 500});
/** @param {...*} KmlMouseEvent */
function KmlLayerClicked(KmlMouseEvent) {
var ClickData = /** @type {google.maps.KmlMouseEvent} */(KmlMouseEvent);
CommonInfoWindow.close();
if (ClickData.featureData && ClickData.featureData.id) {
CommonInfoWindow.setOptions({ "position": ClickData.latLng,
"pixelOffset": ClickData.pixelOffset,
"content": ClickData.featureData.infoWindowHtml
});
CommonInfoWindow.open(map);
}
}
/** @type {google.maps.KmlLayer} */
var KmlOverlay = new google.maps.KmlLayer(KmlUrl, {
'preserveViewport': true,
'suppressInfoWindows': true
});
google.maps.event.addListener(KmlOverlay, "click", KmlLayerClicked);