As others explained, the host country definitely has jurisdiction. Local law enforcement would need to be invited into the embassy to conduct investigations there and diplomatic staff has immunity against any coercive measure but it doesn't mean there is no crime or that prosecution itself is forbidden.
Additionally, some countries have laws on the books providing for prosecution of (serious) crimes committed by or against their citizens, no matter where they take place (abroad, in an embassy or not). Such a law could be used by the sending country to launch an investigation and create some accountability without waiving diplomatic immunity.
Similarly, the sending country could open an investigation if the victim is a diplomat and the host country does not seem interested in prosecuting the crime. Obviously, any coercive measure (subpoena, etc.) and most investigative actions on the territory of the host country would require its cooperation (this has happened before). Depending on the specifics, a third country could even do the same.
Importantly, diplomatic immunity can be waived and, for a diplomat working for an international organization, the decision would be made by the organization itself (and not by the diplomat's country of origin). Depending on who is involved, seeing the immunity waived is a very real possibility in the UN scenario. By contrast, for a diplomat working for a country's delegation, immunity would have to be waived by the sending country and many countries practically never do that (either preferring to prosecute crimes committed by diplomats back home or not holding them accountable at all).