I found a very thick book in the library simply titled "Surnames" (I didn't get the authors name). The following is the definition of the surname Gegner, according to this book.
Gegner - German, topographic name for someone who lived not in the main settlement itself but in the surrounding countryside, from a deriv. of MHG *gegende* (OHG *gegenoti*, a deriv. of *gegin* opposite, against, based on LL *contrata* region, country, from *contra* opposite, against).