its not that simple, you need or a real gen 4 cartridge or transfer your pokemons to a gen 5 real cartridge.
you only can transfer from a gen 4 to 5 with a real cartridge
you only can transfer from a gen 5 to 6 with a real cartridge.
you can transfer from a rom to a real cartridge if the both games are from the same gen (rom of pokemon black can transfer to b/w or b2/bw)
you can try another tools like pokegen or pokecheck, i think pokecheck lets you download the pokemons using gts, you will need to do a lot of work...
if you own a flashcart, it will be more simple, you can dump your black 2 rom, edit it, and then restore it back. but there should be a easier way