The 19-year-old Italian, who is on loan from Arsenal until the end of the season, was the difference between the teams and Derby had some anxious moments before his third goal sealed their passage into the fourth round.
Wrexham battled bravely after falling two goals behind early in the second half and they might have earned a replay but for a marginal offside decision which ruled out a Steve Evans goal.
But Derby should have spared themselves some nerve-jangling moments and they were cruising until Bob Malcolm presented Lee McEvilly with an unexpected lifeline.
Certainly they could be proud of the way a club struggling in League Two gave a team with one eye on the Premiership a thorough examination and, with better luck and better finishing, it could have been an even better day out for the Welsh outfit.
But their next effort on goal opened the scoring when Morten Bisgaard sent Lupoli in on the right and he fired high into the net for his eighth goal of the season.
The midfielder headed the ball into his own six-yard area where McEvilly pounced and rounded Bywater to score.
Suddenly, Wrexham sensed they might cause an upset and Shaun Pejic was only just wide with a header from a Darren Ferguson free-kick.
Another Ferguson cross saw Chris Llewellyn flick the ball on and Evans rammed a shot in at the back post but the linesman had raised his flag for offside.
Derby had lost their earlier composure and shape and Evans had another good chance to equalise in the 79th minute when he climbed to meet a Ferguson free-kick but his header was straight at Bywater.