After eight-game winless run, the 25-year-old delivered a clinical performance to help the Millers bounce back to winning ways at the New York Stadium.
Ajayi put the home team in front two minutes into the encounter after heading home Will Vaulks' long throw.
Amari'i Bell levelled proceedings for Blackburn in the 51st minute but Rotherham retook the lead shortly through Ryan Williams before the Nigeria international completed his brace in the 83rd minute; another header to a Vaulks delivery.
Charles Mulgrew scored a late-minute penalty but Paul Warne’s men held on to their lead to claim their sixth win of the season.
Ajayi featured from start to finish in the encounter in his 35th league appearance for the Millers this term.
Despite the victory, Rotherham remain in the relegation zone after gathering 33 points from 35 games. They visit Sheffield United in their next league game on March 9.