We present the first subarcsecond submillimeter images of the enigmatic ultracompact HII region (UCHII) G5.89-0.39. Observed with the SMA, the 875 micron continuum emission exhibits a shell-like morphology similar to longer wavelengths. By using images with comparable angular resolution at five frequencies obtained from the VLA archive and CARMA, we have removed the free-free component from the 875 micron image. We find five sources of dust emission: two compact warm objects (SMA1 and SMA2) along the periphery of the shell, and three additional regions further out. There is no dust emission inside the shell, supporting the picture of a dust-free cavity surrounded by high density gas. At subarcsecond resolution, most of the molecular gas tracers encircle the UCHII region and appear to constrain its expansion. We also find G5.89-0.39 to be almost completely lacking in organic molecular line emission. The dust cores SMA1 and SMA2 exhibit compact spatial peaks in optically-thin gas tracers (e.g. 34SO2), while SMA1 also coincides with 11.9 micron emission. In CO(3-2), we find a high-velocity north/south bipolar outflow centered on SMA1, aligned with infrared H2 knots, and responsible for much of the maser activity. We conclude that SMA1 is an embedded intermediate mass protostar with an estimated luminosity of 3000 Lsun and a circumstellar mass of ~1 Msun. Finally, we have discovered an NH3 (3,3) maser 12 arcsec northwest of the UCHII region, coincident with a 44 GHz CH3OH maser, and possibly associated with the Br gamma outflow source identified by Puga et al. (2006).