Clarence Seedorf's improving side had previously reeled off five wins on the bounce to climb to seventh in the table, but they were content to frustrate Roma throughout an uneventful opening half-hour.
Adil Rami twice blocked bravely from Adam Ljajic shots, after centre-back Dodo had blazed over the crossbar from a corner, while Milan's threat at the other end was largely limited to shots from distance.
Kaka, who had earlier burst into the box only to see a shot from a tight angle blocked, and Daniele Bonera's long-range efforts were both easy pickings for Roma keeper Morgan De Sanctis.
Although Milan had come under more goalmouth pressure, Christian Abbiati had yet to be called into action when Pjanic collected Francesco Totti's quick free kick to find the bottom corner on 43 minutes.
It was the ninth game in succession that Rudi Garcia's side had taken a first-half lead, and that would have been doubled six minutes after the break had Abbiati not kept out scorer Pjanic at full stretch.
The veteran goalkeeper, though, was arguably at fault for Roma's second as he parried Totti's shot straight into the path of Gervinho, who converted the simplest of tap-ins on 65 minutes.
Milan had much the better of the last 15 minutes as Roma sat back, but De Sanctis denied Riccardo Montolivo and Adel Taarabt on two occasions as Roma refused to give up on an unlikely Serie A triumph.