The congressional district extends from Boyle Heights in the east through downtown Los Angeles to Koreatown. Both candidates are Democrats.
Election night results had Gomez with about a 60-40 lead over Ahn, who called to concede Tuesday evening.
The seat was left vacant after long-time Congressman Xavier Becerra was appointed to be California's attorney general after serving in Congress for more than 20 years.
Ahn had been aiming to become the first Korean-American member of Congress in decades, but Gomez was considered the frontrunner, with endorsements from Becerra and other local political leaders.
County officials said nearly 33,000 ballots were cast, for a turnout of 10.9 percent.