This is a scene from "Dad Clade Walking." It was Episode 14 of Elementary Season 2.
Added:
Sherlock finds himself at a crossroads when his responsibilities as a sobriety sponsor conflict with his personal beliefs on Elementary.
Added:

Elementary Season 2 Episode 14 Quotes

I remove my earlier skepticism. The dinosaur in Doug Newberg's backyard did indeed escape my notice.

Sherlock

Gay: I'm Gay.
Sherlock: I'm not.
Gay: It's my name.