Nit'e Gavriel (Avelus 16:15) says:
One can be lenient and join the simcha of his rebbe, including of the rebbe's descendants, provided the conditions of paragraph 9 are met.
Those conditions are that he not eat at the meal, that he do some labor at the meal [like a waiter] to serve as a marker that he's in mourning, and that he not dance. (In paragraph 10 he says also to absent oneself when there is dance music.)
The footnote on paragraph 15 reads:
So it seems from T'shuvos Raanach (Mayim Amukim 50), who wrote that one can be lenient and join the simcha of his rebbe's son, as reverence of one's rebbe should be like reverence of Heaven and honor for one's rebbe is better than honor for one's parents… so [here] the honor of his parents is deferred for the honor of the rebbe…. This is cited in Tov Leches (on Shulchan Aruch, laws of mourning 391:3). L'shon Chachamim (on laws of mourning, 30) says there's a mitzva to join the simcha of one's rebbe, so can do so in the manner described. Likewise, Sh'elos Usshuvos M'lamed L'hoil 143 wrote one's rebbe is like a relative.