Paul Sykes kicked a last-minute drop-goal to snatch victory for Wakefield and keep alive their play-off hopes.
Hull KR had led 14-8 at the break with two tries from Liam Salter and one from Graeme Horne cancelling out efforts from Ben Cockayne and Peter Fox.
Wakefield replied through Frankie Mariano, Cockayne and Dean Collis before Hull responded through Lincoln Withers, Ben Galea and Josh Hodgson.
Kyle Wood's late try levelled the game before Sykes won it with seconds left.
The result moves Wakefield up to ninth, a point behind Bradford, while Hull KR slip to 10th with just two games of the regular season remaining.
It is the second week running that Sykes has pulled off a game-winning drop-goal after his effort last week against St Helens, and the win is Wakefield's fifth in a row.
They took an early lead through former Rovers star Cockayne before Salter and Horne responded for the hosts.
But Horne was tackled late by Richard Mathers as he crossed for the try and played no further part in the game as he was taken to hospital with a suspected fractured cheekbone.
Three tries in nearly 10 minutes after half-time saw Wakefield take a 26-14 lead before Hull KR responded with three of their own as Withers, Galea and Hodgson all crossed.
But Michael Dobson missed a crucial conversion to give Wakefield hope and when Wood went over late on the scores were level.
Sykes missed the straightforward conversion that would have won the game and with the scores tied at 30-30 Sykes tried his luck with a drop-goal that fell well short.
But his second attempt, from much closer in, won the game and dropped Rovers out of the play-off spots.
Hull KR coach Craig Sandercock:
"Their try before half-time was two metres offside.
"From the restart in the second half, Michael Dobson was nowhere near touching the ball and Ben Galea is ruled offside for diving on the ball. There is 12 points.
"I'm hugely disappointed to get so close and be so far away.
"We were up against a full-strength Wakefield side and we almost got away with what would have been a special win but obviously it wasn't to be."
Wakefield coach Richard Agar:
"I knew we would always get a chance but we didn't want Hull KR getting a chance either.
"We got a penalty when we needed it most but it was a penalty, no qualms about it.
"When we got an opportunity I thought we'd have a chance. We looked threatening in the second half every time we got down their end.
"When we shifted the ball wide we looked good and we have a couple of really smart half-backs."
Hull K R: Sheriff; Latus, Salter, Horne, D. Hodgson; Hall, Dobson; O'Hara, J. Hodgson, Taylor, Lovegrove, Galea, Griffin.
Replacements: Mika for Horne, Paea for O'Hara, Withers for J. Hodgson, Netherton for Taylor.
Wakefield: Mathers; Fox, Collis, L. Smith, Cockayne; Sykes, T. Smith; Amor, Ellis, Raleigh, Lauitiiti, Kirmond, Washbrook.
Replacements: Wilkes for Amor, Wood for Ellis, Johnson for Raleigh, Mariano for Lauitiiti.
Referee: R Silverwood (RFL).