The Nigeria international opened the scoring in the 71st minute of the encounter before the effort was cancelled out by Bright Osayi-Samuel.
Just before time, the 25-year-old scored the match-winning goal, heading home from Anthony Forde’s cross to help his side claim their first away victory since April and his gaffer has expressed his delight on the performance.
“It is important for us to pick up points obviously, and that’s our first away win for a while. It means a lot to the lads," Warne told club website.
“For Forde to put in a quality ball in like that, and for Semi to attack it, especially where our fans were, was a really special moment.”
Despite the victory, Rotherham remain in the relegation zone after gathering 36 points from 37 games.
Ajayi who has now scored six goals in 37 league games will look forward to another fine outing when they trade tackles with Norwich City on Saturday.