The feat that does what you want is called spectral strike. Unfortunately, it requires a Wisdom of 19, the ability to turn or rebuke undead, and you need to be at least level 21. You won't be able to take this feat, but it's worth noting that such a feat exists.
There are some other options. The easiest is having a spellcaster cast the spell ghost touch weapon (Spell Compendium 102), or to somehow acquire Ghostoil (Libris Mortis 73), either by purchasing it (it only costs 50 gp per dose, but finding it if you're in the middle of a dungeon is nontrivial) or crafting it (if you or a party member has ranks in Craft (Alchemist), though again this may be tricky in the middle of a dungeon).
One option that you can get on your own is the Crystal Helm soulmeld (Magic of Incarnum 63). If you bind it to your crown chakra, your melee attacks gain the [Force] descriptor, letting them work normally against incorporeal foes. You can pick this up via feats, by taking Shape Soulmeld (Crystal Helm) and then Open Least Chakra (Crown). You could also take two levels of Incarnate, which would lose you a point of Base Attack Bonus but gain you +2 Fortitude save and +3 (ish) Will save over continuing Dervish. The downside, of course, is delaying the cool Dervish abilities (though you'd get other soulmelds in addition to Crystal Helm).
There's the feat Incorporeal Target Fighting (Ghostwalk 36) which lets you reroll miss chances against incorporeal foes (you'd need a magic weapon of some sort, but I should hope you have one by level 7).
Lastly, if you're of a Good alignment, you can take the feat Ancestral Relic (Book of Exalted Deeds 39). This will let you sacrifice random loot to add enhancements to your weapon, including the ghost touch property. This feat is great in a campaign without ready access to shops. Using it to add ghost touch is a bit mediocre, though. You usually want more generally useful enhancements on your relic weapon.
Of these options, none are good. Your comment that "there might be a ghost" has me worried, because you shouldn't be devoting your character resources like feats or levels to fighting a single enemy. If there were a feat that just read "Your melee attacks instantly destroy ghosts," you still wouldn't take that for a single fight. If you're expecting to fight many ghosts, many times before you get the chance to buy or craft anything, then Ancestral Relic for ghost touch becomes interesting. Barring that, just let the spellcasters deal with it. Any cleric will give a ghost a very hard time, and most other spellcasters will still be able to deal with one by level 7. You're not a Barbarian, so you can write a note to the cleric to prepare ghost touch weapon.
Basically, ghosts are hard for fighters to deal with. They fly, they're incorporeal, they can target Will saves—ghosts are spooky. But the solution is to let your friends cover your weaknesses, not to cripple your own character for the sake of a single encounter. (If no one in the party is a spellcaster, then you're a dervish with fast movement and no encumbrance; you don't need to be faster than the ghost, just faster than the other party members.)