Major depression and anxiety disorders are a social and economic burden worldwide. Serotonergic signaling has been implicated in the pathophysiology of these disorders and thus has been a crucial target for pharmacotherapy. However, the precise mechanisms underlying these disorders are still unclear. Here, we used species-optimized lentiviral vectors that were capable of efficient and specific transduction of serotonergic neurons in mice and rats for elucidation of serotonergic roles in anxiety-like behaviors and active coping behavior in both species. Immunohistochemical analyses revealed that lentiviral vectors with an upstream sequence of tryptophan hydroxylase 2 gene efficiently transduced serotonergic neurons with a specificity of approximately 95% in both mice and rats. Electrophysiological recordings showed that these lentiviral vectors induced sufficient expression of optogenetic tools for precise control of serotonergic neurons. Using these vectors, we demonstrate that acute activation of serotonergic neurons in the dorsal raphe nucleus increases active coping with inescapable stress in rats and mice in a time-locked manner, and that acute inhibition of these neurons increases anxiety-like behaviors specifically in rats. These findings further our understanding of the pathophysiological role of dorsal raphe serotonergic neurons in different species and the role of these neurons as therapeutic targets in major depression and anxiety disorders.