The most obvious way that African Americans contributed to their freedom during the Civil War was by bearing arms. For instance, the famous 54th infantry from Massachusetts fought bravely. They were the ones how stormed Fort Wagner. To be sure, the 54th was destroyed, but they fought for their freedom. Others were also allowed.
African Americans also lobbied and pleaded for abolition. From this perspective, we can say that the movement for emancipation started way before the Civil War, and it certainly continued during the war.
Finally, many slaves ran away from the South, and other slaves from the North aided them. This allowed for greater communication and information to be sent to the North about what was taking place in the South. These stories would not fall on deaf ears with president Lincoln.