The performance from Brennan Johnson helped the Forest to a victory.
The forward put the visitors in front from the penalty spot, but Scott Wharton tied the game at the half.
Lingard's free-kick made it 2-2 before Taiwo Awon strike made it three.
Johnson scored a second goal late in the game.
The Championship promotion hunters, who are currently third in the second tier, struggled to contain Forest because of the 11 changes made by the manager.
The forward, who was one of three World Cup players picked to start for Forest, converted the 12th-minute penalty after drawing a foul from Wharton.
Despite having 16 first-half shots, Forest could not extend their lead and Wharton headed home a free-kick taken by younger brother Adam.
Steve Cooper's side went back in front when Lingard's free-kick took two bounces before rolling past Pears.
Awoniyi was able to secure Forest's progression by rolling away from Wharton and finishing calmly past Pears, who made several good saves to keep the score respectable.
Johnson struck low past Pears from inside the box in the final seconds of the game.
The draw for the quarter-finals of the cup will be held on Thursday night.