Optical microscopy, owing to its noninvasiveness and subcellular resolution, enables in vivo visualization of neuronal structure and function in the physiological context. Optical-sectioning structured illumination microscopy (OS-SIM) is a widefield fluorescence imaging technique that uses structured illumination patterns to encode in-focus structures and optically sections 3D samples. However, its application to in vivo imaging has been limited. In this study, we optimized OS-SIM for in vivo neural imaging. We modified OS-SIM reconstruction algorithms to improve signal-to-noise ratio and correct motion-induced artifacts in live samples. Incorporating an adaptive optics (AO) module to OS-SIM, we found that correcting sample-induced optical aberrations was essential for achieving accurate structural and functional characterizations in vivo. With AO OS-SIM, we demonstrated fast, high-resolution in vivo imaging with optical sectioning for structural imaging of mouse cortical neurons and zebrafish larval motor neurons, and functional imaging of quantal synaptic transmission at Drosophila larval neuromuscular junctions.