Razzak, making a Test return after four years, and fellow left-arm spinner Taijul Islam claimed four wickets each to wrap up the Sri Lankan innings shortly after tea.
Sri Lanka paceman Suranga Lakmal then picked up two wickets to leave the hosts tottering at 56-4 at stumps. Liton Das, on 24, and nightwatchman Mehedi Miraz, on five, were batting at close of play.
Lakmal drew first blood after taking a return catch off his own bowling to remove Tamim Iqbal for four in just the third ball of the Bangladesh innings.
Lakmal then bowled Mushfiqur Rahim for one before Dilruwan Perera ended the brief resistance of Imrul Kayes, who made 19.
More From This Section
"I think the game is still balanced because we have to take another six wickets, we have to bat another innings and we have to bowl them out in another innings," said Sri Lanka batting coach Thilan Samaraweera.
"For me, I think we were 30 runs short. Normally, on a Dhaka wicket 240, 250 is a very good score," he said.
Taijul complemented Razzak's effort and claimed the final wicket of Roshen Silva, who made 56 after Kusal Mendis top- scored with 68 for the Sri Lanka.
Silva was involved in two dogged partnerships with Perera (31) and Akila Dananjaya (20) against a persistent Bangladesh bowling attack.
"I think it is definitely a result-oriented wicket and the match, given its current state, may not go in to the fifth day," Razzak said after opening day's play.
"It wasn't an unplayable wicket in a larger sense. This type of turn is evident in a lot of places. It wasn't stopping or keeping low," he said.
Mendis brought up his 50 in 81 balls with a six off Taijul but Razzak rocked Sri Lanka with two wickets in two balls.