Hint $\ f = x\!+\!5 + \color{#c00}c\,(\overbrace{x^2\!+\!x\!+\!1}^{\large g})\ $ and $\ {-}2 = \color{#0a0}{f\bmod x\!+\!1} = f(-1) = 4\!+\!c\iff \color{#c00}{c = -6}$
See this Remark for more detail, and the relationship to CRT and Lagrange interpolation.
Remark $\:\!\ $ Or use $\,\ fg\bmod hg\, =\, [f\bmod h]\,g\,= $ mod Distributive Law $ $ algorithmically
$$\,\ \ \begin{align}
f-(x\!+\!5)\ \bmod\ (x\!+\!1)g\,
=\ &\left[\dfrac{f-(x\!+\!5)}{g}\bmod\, x\!+\!1\right]g\ \ \ {\rm by}\ \ \ f\equiv x\!+\!5\!\!\!\pmod{\!g}\\[.3em]
=\ &\left[\dfrac{f(-1)-4}{1}\right]g\ \ \ \,{\rm by}\ \ \ g\bmod x\!+\!1 = g(-1) = 1\\[.3em]
=\ &[\color{#c00}{\,-6}\,]\,g\ \ \ {\rm by}\ \ f(-1)=\color{#0a0}{f\bmod x\!+\!1} = x\!-\!1\bmod x\!+\!1 = -2
\end{align}$$
Note that we did not need to solve any equations - only evaluate polynomials at $\,x=-1$
The same method works generally:
Lemma $\,\ \bbox[7px,border:1px solid #c00]{f\bmod (x\!-\!a)g\, =\, f_g + \left[\dfrac{f(a)- f_g(a)}{g(a)}\right]g}\ \ $ if $\ g(a)\neq 0,\,$ for $\,f_g := f\bmod g$
$\begin{align}{\bf Proof}\ \ \ \
f-f_g\ \bmod\ (x\!-\!a)g\,
=\ &\left[\dfrac{f-f_g}{g}\bmod\, x\!-\!a\right]g\\[.3em]
=\ &\left[\dfrac{f(a)-f_g(a)}{g(a)}\right]g
\end{align}$
The formula does not require solving equations, only evaluating a few polynomials at $\,x=a$
Note $ $ The $\!\bmod\!$ Distributive Law can be viewed as an equivalent "shifty" operational reformulation of CRT = Chinese Remainder Theorem, as I explain in the end of my Remark here. It is often more convenient to apply in practice because of its operational nature, e.g. here are many examples.