Of course. As a wedding guest you aren't expected to dress in sackcloth and ashes. Don't worry about outshining the bride or wearing the same color as the wedding party - even if you're trying there's NO CHANCE you're going to be mistaken for either the bride or a bridesmaid. Wear what you want to wear.
I've been to plenty of long dresses on wedding guests that neither looked too casual nor like formal prom dresses. If people keep trying to whittle away what's acceptable for guests to wear, pretty soon we'll all be showing up in barrels with straps. Can't wear white, black, red, or a color even remotely resembling the wedding colors and can't wear a dress that isn't too long, too short, too showy or too plain. Seriously - before long everyone will either be in bathrobes or barrels.