Luxembourg beat Republic of Ireland on Saturday and led the European champions through Gerson Rodrigues’ header.
But Liverpool forward Jota headed home in the final attack of the first half.
Ronaldo tapped in early in the second half to turn the tide in Portugal’s favour, with Joao Palhinha glancing in a header to seal the win.
Before that Jota had gone close with a header that hit the bar, while Ronaldo could have had a second goal himself, but failed twice to beat home goalkeeper Anthony Moris after running clear of the defence.
What at one stage looked to be a night of such promise for Luxembourg ended with them reduced to 10 men as Maxime Chanot was shown a second yellow for a foul on Renato Sanches.
The win takes Portugal to seven points in qualifying Group A, level with Serbia, with whom they controversially drew 2-2 at the weekend.