Cockayne, who was sacked by Rovers in 2011 following a series of disciplinary breaches, struck with the last three tries of the match to end a brave fightback by his old team-mates.
"Hull KR fans are appreciative of Ben Cockayne and I think it's great that opposing fans respect players who have given their all for the club," Agar said. "That's a great tribute to the Hull KR fans but I am sure they will be cursing him a bit tonight."
Agar had labelled the performance of his team in last week's season-opening 40-6 defeat at Bradford as the worst since he took charge, but they looked a different team following the return from injury of 2012 player of the year Tim Smith and ever-reliable prop Andy Raleigh.
"I thought they made a big difference to the team," Agar said. "Timmy is a player who, if you give him a bit of a platform, can come up with some good plays.
"It will do us good to get that win in front of our own fans. We showed we can be a really competitive team if we get certain elements of our game in order.
"We controlled the ruck really well and I thought it would tell late in the game."
Already without six members of their senior squad, Rovers lost makeshift stand-off Lincoln Withers in the very first tackle of the match.
The game was held up for four and a half minutes to enable Withers to receive treatment for a head injury - the result of an attempted tackle on Wakefield prop Justin Poore that went badly wrong.
"He's gone to hospital," Rovers coach Craig Sandercock said. "He's in a pretty bad way and obviously my thoughts are with Lincoln and his family. He was knocked out cold and I'm led to believe he had quite a big head gash as well. That's all we've got at this stage. I need to get a thorough report on him."