Late goals from Liverpool's Philippe Coutinho and QPR substitute Eduardo Vargas made the scoreline two apiece in the closing stages at Loftus Road, but home defender Steven Caulker turned the ball into his own net in the fifth minute of stoppage time to gift the Reds maximum points.
However, Rodgers has conceded that Harry Redknapp's men "didn't deserve to lose" the match.
"They didn't deserve to lose. I think we were very, very lucky to get the win. We showed tremendous character and were a little bit better in the second half, but QPR definitely deserved something from the game," Rodgers told Sky Sports News.
Next up for Liverpool is a Champions League group encounter against holders Real Madrid on Wednesday night.