Safet Susic's men completed their maiden World Cup campaign with a 3-1 win over Iran in Salvador, finishing third in Group F.
A loss to Nigeria had ended Bosnia's chances of reaching the last 16, but only after Dzeko had a goal incorrectly ruled out for offside.
Dzeko, who opened the scoring against Iran, said he would always remember the disallowed goal.
"Despite the victory, we go home sad as we could've gone further," he said.
"The goal they cancelled out against Nigeria I will remember until the end of my life."
Miralem Pjanic and Avdija Vrsajevic were also on the scoresheet for Bosnia, who had been briefly pulled back to 2-1 when Reza Ghoochannejhad tapped in for Iran.
Pjanic was disappointed his team were unable to progress further and he also lamented his side's performance against Nigeria.
"I'm glad I scored at the World Cup, but I am sorry that we did not achieve what we wanted," he said.
"If we had a bit more luck we could have got out of the group. We gave our best and it was a great experience for us. In the second game we did not work hard, but we have to look forward."
Get the best features, fun and footballing frolics straight to your inbox every week.