The Belgians were still trailing to a first-half penalty by Sofiane Feghouli when Fellaini entered the fray in the 65th minute, to beef up the attack for manager Marc Wilmots. Just five minutes after replacing Moussa Dembele, the United midfielder met a brilliant cross by Kevin De Bruyne and beat Algerian goalkeeper Rais Mbolhi with a fine header.
Fellaini was denied a second goal by a decent save as the Belgians continued to assert themselves, in stark contrast to a disappointing first period when Feghouli's spot-kick in the 25th minute - after being fouled himself by Tottenham defender Jan Vertonghen - gave Algeria a shock lead.
To address it in the second half, Wilmots made his maximum three changes, with Dries Mertens coming on for Nacer Chadli at the restart and Divock Origi preceding Fellaini onto the pitch as replacement for Romelu Lukaku, the Chelsea striker who spent last season on loan at Everton. United's Adnan Januzaj therefore remained on the bench in Belo Horizonte as an unused sub.
Belgium's winner came 10 minutes from time, when De Bruyne's well-timed tackle turned defence into a lightning counter-attack. Eden Hazard's pass picked out Martens and the latter finished the sweeping move in style by smashing a rising shot beyond Mbolhi.
The next Group H fixture for Fellaini and co could prove to be another tough one, as they face Fabio Capello's Russia in Rio at 17:00 BST on Sunday.