American Airlines made a wild bet that a hamburger it serves at the airport could be crowned the best in New York City.

The airline went up against more than 30 local restaurants, venues and food companies at the New York City Wine & Food Festival on Friday night at a pier on Manhattan's West Side, an event American sponsored but never participated in before this year.

The single-grind, sirloin patty is served on a brioche bun with aged cheddar, red onion, bacon marmalade, arugula and beefsteak tomatoes at American's first-class lounge at John F. Kennedy International Airport, as well as at similar lounges in Los Angeles and Miami. American was trying to draw attention to service for those who sit in the front of the plane, as airlines battle for top-paying passengers with higher-end food options.

Chef John Ogden said he went through about a dozen iterations before settling on this one, which was first served in the lounge in May 2017. Rival United Airlines offers its own bacon-topped burger at its new Polaris lounges, which are for passengers traveling in first or business class on international flights. It also sells coach passengers a $10 burger on some flights and in its own gimmick, served some up out of a food truck near Bryant Park in midtown Manhattan earlier this month.

Hundreds of burger enthusiasts at the festival made their way from table to table, snatching up the quartered patties as a loud cover band belted out pop songs.

Competition was stiff. The entry from Pig Beach, a barbecue joint in the Gowanus section of Brooklyn, was short rib on a potato roll served with white American cheese, house-made pickles and a mustard-mayo sauce. BK Jani, a Pakistani restaurant in Bushwick served its burger with crispy, masala-spiced fries.

But American's airport entry won over some attendees.

"It's actually not that bad. I would have expected it to be worse," said Tracey Pelella, a 56-year-old customer service director for a utility company in Connecticut, who said she sampled more than a dozen burgers. "I'm surprised American is even here."

Craig Messmer, a mechanical engineer based in St. Louis who is also 56 years old, said American's "Flagship burger" was his favorite at the event because others that had a lot of condiments were too "over the top."

"Everyone thinks: American Airlines? I was surprised they were No. 1," he said.

Four judges, including actor Neil Patrick Harris and Andrew Zimmern, host of the Travel Channel program "Bizarre Foods," named a winner after a blind taste test of the burgers.

"This was the first time the judges ever agreed," said celebrity chef Rachael Ray, who hosted the event.

Zimmern called the airline's entry into the burger battle "smart" and said he's had good meals on long-haul flights with U.S. carriers. Airlines should also pay attention to their shorter flights too, he added. "If you're going New York to Chicago, if you're going to feed something to someone it doesn't need to be expensive or fancy, but make it good. It's not that hard," he said.

Alas, American lost to another underdog: the New York Mets.

Citi Field will serve its winner — ground, dry-aged beef, with stewed onions, house-cured bacon, and a sharp cheddar cheese sauce next spring.

For American, as Mets fans would say, there's always next year.

WATCH: How takeout took over America