Changes in illumination can rapidly influence behavior that is normally controlled by the circadian clock. This effect is termed masking. In mice, masking requires melanopsin-expressing retinal ganglion cells that detect blue light and project to the thalamus. It is not known whether masking is wavelength-dependent in other vertebrates, nor is it known whether the thalamus is also involved or how it influences masking. Here, we address these questions in zebrafish. We find that diel vertical migration, a circadian behavior in larval zebrafish, is effectively triggered by blue, but not by red light. Two-photon calcium imaging reveals that a thalamic nucleus and a downstream structure, the habenula, have a sustained response to blue but not to red light. Lesioning the habenula reduces light-evoked climbing. These data suggest that the thalamo-habenula pathway is involved in the ability of blue light to influence a circadian behavior.