Jack Wilshere earlier twice smashed the ball into the top corner from outside the area, his first international goals, as England moved within touching distance of the finals in France with 18 points from six Group E games, nine above second-placed Slovenia.
Milivoje Novakovic had coolly given the hosts a 37th-minute lead after a series of England errors and Nejc Pecnik made it 2-2 late on before a defensive howler set up Rooney for his 48th England goal, one behind record holder Bobby Charlton.
“It was a long time ago when England last went a season unbeaten and we’re proud of that achievement,” Rooney told ITV after the Three Lions managed the feat for the first time since 1990-91.
“We need to keep improving now over the next season and make sure we qualify for the Euros. We’re certainly a team that is progressing.”
Raheem Sterling missed a golden chance early on for England and also shot narrowly wide after 14 minutes with his mixed performance under particular scrutiny.
He was kept in the starting line-up despite being booed in the recent 0-0 friendly with Ireland because of an average display and his behaviour in requesting to leave Liverpool.
Novakovic then grabbed the opener against the run of play.
Right back Phil Jones bungled a throw-in and Slovenia quickly broke up field where England played too high a line and enabled the 36-year-old to amble on to a through ball and calmly slot beyond Joe Hart.
Jones was substituted for midfielder Adam Lallana at halftime, with media reports blaming an ankle injury, and midfielder Jordan Henderson was employed at right back.
England made three starting changes from the bore draw in Dublin with Kieran Gibbs replacing Ryan Bertrand at left back and Fabian Delph and Andros Townsend coming into midfield.
The trio had their moments but Lallana’s introduction made the difference with the tricky player having a hand in both Wilshere’s wonderful strikes, in what was the best game in an England shirt for the Arsenal man.
Club team mate Gibbs was as fault for Slovenia’s equaliser with former Sheffield Wednesday player Nejc Pecnik climbing above him to head home after 84 minutes.
But just a minute later, Rooney latched on to misplaced intervention from Bojan Jokic and, having missed two easier chances earlier, fired home as England almost booked their passage to France with the top two qualifying automatically.
(Writing by Mark Meadows; editing by Martyn Herman)