Greig finished a Peter Toth cross on the counter attack in the 42nd minute to pace the Energy to 1-0 lead at halftime.
Townsend netted his goal in the 51st, making the most of his run by placing his shot in the upper corner of the near post.
The Premier Development League’s Sockers, who defeated the Tulsa Athletics 3-1 in their Open Cup debut last week, pulled one back in the 68th minute through Beto Garcia’s finish of an Andrew Fox cross into the penalty area.
But two minutes later, Greig struck again as he headed home a long flip throw in by Michael Harris.
“We talked about their long throw and how dangerous it was. We didn’t mark the guy who headed the ball,” Garcia said. “So next time we have to learn from this pro experience that we just had.”
The Energy advance to face USL conference foe Tulsa Roughnecks FC in Third Round action.
“This is a nice little confidence boost for us against a great side here,” Greig said.
Full match replay: OKC Energy vs. Midland-Odessa Sockers FC