The ninth-wicket pair saved Bangladesh from a follow-on with a crucial stand of 77 runs against a tiring Indian attack that sorely missed spin spearhead Anil Kumble, who was down with viral fever.
Bangladesh, who were reduced to 149-8 at one stage and needed a further 39 runs to save the follow-on, went on to make 238 in reply to India's first innings total of 387-8 declared.
India were 44-2 in their second knock at stumps, an overall lead of 193 runs with eight wickets in hand going into the final day's play at the Ruhul Amin stadium.
The 23-year-old Mortaza, who averaged 8.57 runs with the bat in 20 previous Tests, hit a brilliant 79 with seven boundaries and three sixes before he was last man out.
Hossain, 20, made light of his average of 6.11 to strike 31 and partner his new ball colleague Mortaza in a face-saving stand before 10,000 screaming home fans.
The fired-up Hossain then handed opener Wasim Jaffer a second successive duck in the match and also removed Indian captain Rahul Dravid to leave the tourists precariously placed at 6-2.
But Sachin Tendulkar (24 not out) and Dinesh Karthick (15 not out) saw out the day in fading light with a draw looming large in the rain-curtailed match.
Until Mortaza and Hossain came to the crease, Bangladesh's batting floundered, failing to infuse life into the Test after incessant rain restricted play to just 97 overs over the first three days.
None of the top seven batsmen crossed 50 with Rajin Saleh's 41 the best until Mortaza and Hossain showed how to tackle the bone-dry wicket that offered no assistance to the bowlers.
India's two young seamers, Rudra Pratap Singh and Vikram Rajvir Singh, claimed three wickets each and debutant off-spinner Ramesh Powar took two.
Rudra Pratap, aged 21 and playing only his third Test, dismissed Javed Omar and captain Habibur Bashar in three balls and Zaheer Khan removed Shahriar Nafees (32) to leave the hosts on 49-3 at lunch.
Rudra Pratap struck again soon after lunch when Mohammad Ashraful was caught superbly at gully by Karthick, who dived to his left to pluck the ball one-handed.
Saleh and debutant Saqibul Hasan put on 56 for the fifth wicket when India hit back to remove both batsmen in the space of six deliveries.
Left-handed Saqibul played on to Vikram Rajvir after making 27 and Saleh holed out to point against Powar for 41.
Ealier, India, who resumed at Saturday's score of 384-6, lost two wickets for three runs before Dravid declared 11 minutes after the start.
Mortaza was his team's chief wicket-taker with 4-97, while Hossain took 3-76.
The second and final Test will be played in Dhaka from Friday.