Pepe, who missed a large portion of this season due to injury, scored with an angled shot that deflected in off a defender.
Six minutes earlier, Lazio midfielder Cristian Ledesma was sent off after receiving his second yellow card for stopping a Juventus counterattack.
Lazio remained in fourth place - which carries the final Champions League berth - but is only one point in front of both Udinese and Roma. Juventus, which is seventh, moved within four points of Lazio with three matches remaining in the Italian league.
Lazio had dominated until Ledesma was sent off.