A more rigorous way to do this is as follows. Define a new variable: $$S\equiv\frac{\dfrac{\gamma}{c_t}}{\dfrac{1-\gamma}{c_{t+1}}}.$$ By simple rearrangement, you can compute that $$\frac{c_{t+1}}{c_t}=\frac{1-\gamma}{\gamma}\times S.$$ Hence, if you imagine $c_{t+1}/c_t$ as a function of $S$, you have that $$\frac{\mathrm{d}\left(\dfrac{c_{t+1}}{c_t}\right)}{\mathrm d S}=\frac{1-\gamma}{\gamma},$$ since $c_{t+1}/c_t$ is just a linear function of $S$ with coefficient $(1-\gamma)/\gamma$.
In your original question, “bringing out $(1-\gamma)/\gamma$ out of the denominator” is an informal operation, since what appears there is, in fact, a differential operator and, rigorously speaking, there is no “denominator;” it's just a conventional notation. However, the informal trick of “bringing out $(1-\gamma)/\gamma$ out of the denominator” does work in most cases, which serves as a justification for denoting the differential operation as though it were a fraction.
In general, you may want to use the implicit function theorem to take the derivative of one quantity with respect to another if the functional relationship between these two quantities is complicated.