The teenager followed up his 55 on debut against Yorkshire last month with a composed 58 – the only half-century in the match so far – as Sussex recovered to make 226.
Their understrength attack then chipped away at Glamorgan who were 205 for nine when play was halted by rain. Four bowlers took two wickets including leg-spinner Will Beer, whose scalps were his first in the County Championship since September 2019.
Sussex had resumed on 161 for seven and added two runs before Jack Carson played on to Mick Hogan for a duck in the second over of the day. But Ibrahim, leaving the ball well and accumulating runs in unhurried fashion, helped Stuart Meaker and Mitch Claydon add 63 for the last two wickets. Meaker made 23 and Ibrahim was last out for 58, made from 147 balls with four boundaries before he was stumped off off-spinner Andrew Salter.
In reply, most of the Glamorgan batsmen got starts but no one could better opener David Lloyd’s 38 as the Sussex attack plugged away.
Meaker picked up Joe Cooke (15) with one which straightened and Colin Ingram’s first Championship innings since September 2017 ended when Claydon surprised him with extra bounce and he was caught off the splice for seven.
Root and David Lloyd put on 54 for the third wicket with few alarms but Meaker returned to bowl Lloyd (38) through the gate and Claydon had Kiran Carlson (17) athletically caught at second slip by the diving Aaron Thomasson.
Billy Root (37) played attractively before he was lbw to Stiaan van Zyl to leave Glamorgan 117 for five. Skipper Chris Cooke and Dan Douthwaite put on 40 either side of tea, although Douthwaite was put down by Carson off his own bowling on 15.
Beer broke through after the interval when Douthwaite (17) was caught at slip on the drive and Carson picked up Cooke (29) thanks to an excellent low catch at short leg by Thomason.
Beer bowled with impressive control, picking up his second wicket when he defeated James Weighell's (17) defensive prod. In the next over Timm van der Gugten (1) holed out to deep mid-wicket to give Carson a second wicket.
Hogan and Salter scrambled a batting point before the rain got heavier, but an intriguing final two days are in prospect as both sides try to climb the Group C table.
Claydon said: "I think we are in a good position. When we were bowled out this morning we would definitely have taken them being nine down at the close. It was a great effort and if rain doesn't have too much of a say I think there will be a positive result. Hopefully we can get enough overs in tomorrow despite the forecast to push on with the bat and give our spinners something to bowl at on the last day.
"Young Dan Ibrahim is so calm and composed at the crease, it's incredible really for a 16-year-old. He played some lovely cricket shots and spent a lot of time at the crease. He is one of some very exciting young cricketers at the club."