Step 1: Set up the division.
Dividing $P(x)=2x^5+kx^4+5x^3-3x^2+2x-1$ by $D(x)=x^2+x+1$ gives a quotient $Q(x)$ and remainder $R(x)$. Since the divisor has degree $2$, the remainder has degree below $2$. We are told the remainder is the constant $5$.
Step 2: Guess the quotient shape.
Because the top has degree $5$ and the divisor degree $2$, the quotient has degree $3$: write $Q(x)=2x^3+px^2+qx+r$. The leading $2x^3$ comes from $2x^5\div x^2$.
Step 3: Multiply back the first piece.
$2x^3\cdot(x^2+x+1)=2x^5+2x^4+2x^3$. Subtract from $P(x)$: the $x^4$ term becomes $(k-2)x^4$ and the $x^3$ term becomes $(5-2)x^3=3x^3$.
Step 4: Match the $x^4$ term.
The next quotient term times $x^2$ must clear $(k-2)x^4$, so that term is $(k-2)x^2$. From the listed quotient the $x^2$ coefficient is $-5$, so $k-2=-5$, giving $k=-3$.
Step 5: Carry the division forward.
Using $p=-5$, multiply $-5x^2(x^2+x+1)=-5x^4-5x^3-5x^2$ and subtract. The running $x^3$ coefficient becomes $3-(-5)=8$, so the next quotient term is $8x$.
Step 6: Finish the last term.
Multiplying $8x(x^2+x+1)=8x^3+8x^2+8x$ and subtracting, the constant quotient term works out to $-6$ so the leftover matches the remainder $5$. So $Q(x)=2x^3-5x^2+8x-6$.
Step 7: State the quotient.
\[ \boxed{2x^3-5x^2+8x-6} \]