First order condition of log functions in general and interpretation
It just comes from the derivative of profit function. I assume that $a_i$ is the choice variable here so the derivative of $\pi$ wrt $a_i$ is (step by step):
$$\frac{\partial \pi}{ \partial a_i} = \frac{\partial \pi}{ \partial a_i} [ \ln R(a_i) ]  +  \frac{\partial \pi}{ \partial a_i} [ \ln N_i(\gamma a_i, \gamma a_{-i}) ]  \\ 
= \frac{1}{ R(a_i)}   R'(a_i)  +  \frac{1}{ N_i(\gamma a_i, \gamma a_{-i})}  N_i'(\gamma a_i, \gamma a_{-i}) \gamma $$
The gamma at the end pops out because of the chain rule. If you have $G(H(F(x)))$ then $\frac{dG}{dx} = \frac{dG}{dH} \frac{dH}{dF}\frac{dF}{dx}$. You just simply have to realize that $\gamma a_i = F(a_i) $.
Lastly to derive FOC you just set the last equation above to zero and you are there:
$$\frac{1}{ R(a_i)}   R'(a_i)  +  \frac{1}{ N_i(\gamma a_i, \gamma a_{-i})}  N_i'(\gamma a_i, \gamma a_{-i}) \gamma = 0 \\ \frac{ R'(a_i)}{ R(a_i)}    = - \gamma \frac{ N_i'(\gamma a_i, \gamma a_{-i})}{ N_i(\gamma a_i, \gamma a_{-i})} $$
To sum up, the $-\gamma$ is there because of the chain rule, nothing special aside of taking derivative is going on here.
PS: I just realized that I forgot to explain why you can interpret them as elasticities but great +1 answer of Herr K. already did that so I wont unnecessarily repeat it here.