Nicholls, who used up two lives early in his innings, had a third on 92 when he was dropped by Azhar Ali and progressed to reach 100 with a cover drive to the boundary.
Gabriel, in his 50th Test, was clearly frustrated when Darren Bravo dropped a regulation chance at first slip with Nicholls on 47, but he had reason to smile in his next over when he had Will Young caught at second slip by Jason Holder for 43.
The return of wicketkeeper BJ Watling has allowed Tom Blundell to return to his opening slot alongside stand-in captain Latham while Will Young moves to number three.