Having taken full advantage of Jamal Lewis' calamitous error midway through the first half, Dzeko – who also had a seemingly legitimate goal disallowed – wrapped up the points 17 minutes from time.
The Roma striker's clinical finishing came in stark contrast to Northern Ireland's profligacy, with substitute Gavin Whyte passing up the best of some golden opportunities when he struck the woodwork from point-blank range.
Michael O'Neill's side will drop down to the third tier if Austria secure one point from their two remaining games, which includes a trip to Windsor Park, while Bosnia-Herzegovina just need a draw to clinch promotion to League A.
UEFA Nations League (@UEFAEURO) October 15, 2018
George Saville should have done better from Steven Davis' pinpoint cross after quarter of an hour and the midfielder went closer five minutes later when his half-volley rattled the right-hand upright.
Northern Ireland's bad luck continued in the 27th minute, Edin Visca pouncing on Lewis' slip to tee up Dzeko, who made no mistake with a tidy first-time finish.
Lewis could have been at fault for a second Bosnia-Herzegovina goal when he appeared to play Dzeko onside from Miralem Pjanic's set-piece, but the assistant referee's flag spared his blushes after a blistering volley from the striker.
Whyte looked set to haul Northern Ireland level in the 66th minute, only for the 22-year-old to somehow hit the post from six yards out with the goal gaping.
The visitors were made to pay when Dzeko beat the offside trap and curled Pjanic's pass beyond Bailey Peacock-Farrell.
The woodwork again denied Whyte in stoppage time as Northern Ireland failed to stop Bosnia-Herzegovina extending their 100 per cent Nations League record to three matches.
What it means: Profligacy proves costly
Northern Ireland have had no trouble creating opportunities in their Nations League campaign, but their failure to convert those chances into goals has piled too much pressure on their defence. The positive signs are there, but unless O'Neill's side begin to hit the target, it does not bode well heading into Euro 2020 qualification.
Dzeko had hardly touched the ball before slotting in the opener and he showed wonderful skill for the goal that was disallowed before finally getting his second late on. With his quality up top, Bosnia-Herzegovina will be confident of securing promotion to League A when they face Austria next time out.
Lewis at fault again
It has been a difficult start to life on the international stage for Norwich City youngster Lewis, who had now made errors leading to goals in all three of Northern Ireland's Nations League fixtures. It was only Lewis' fifth cap, but he will need to learn quickly if he is to cement a place in O'Neill's side.
Key Opta facts:
- Bosnia-Herzegovina are unbeaten in their last eight matches in all competitions, winning five and drawing three.
- Northern Ireland are winless in their last six away matches in all competitions, failing to score a single goal in that run (D2 L4).
- Two of Northern Ireland's three shots on target in this match came in the final five minutes.
- Dzeko has been directly involved in seven goals in his last six competitive appearances for Bosnia-Herzegovina (five goals, two assists).
Northern Ireland face neighbours the Republic of Ireland in their next outing, before finalising their Nations League group campaign with a fixture against Austria, which will be a dead rubber if Franco Foda's side avoid defeat against Bosnia-Herzegovina.