The Biancocelesti went into the game in poor form after picking up two draws and two defeats between the league and Europa League, but they overcame their rivals in Jose Mourinho's first derby in charge of Roma.
"We finally had a good game. We played a lot better than in the previous matches," Lazio midfielder Sergej Milinkovic-Savic told DAZN.
"We needed a derby win to go ahead and have extra motivation in our next matches."
Milinkovic-Savic headed in the opener, before Pedro scored against his former club to double Lazio's lead and become the third player to score for both teams in the capital derby, after netting for Roma in this fixture in May.
Nicolo Zaniolo struck the post before Roger Ibanez pulled one back for Mourinho's side, but Felipe Anderson restored a two-goal advantage for Lazio in the second half by finishing off a clinical counter-attack.
Lazio climbed to sixth place on 11 points, one point behind fourth-placed Roma.