NEW YORK (AP) American qualifier Taylor Townsend nearly inaugurated the new Grandstand Stadium with an upset.

The 20-year-old Townsend split the first two sets with two-time U.S. Open finalist Caroline Wozniacki in front of a near-capacity crowd of 8,000 in the new digs at the USTA Billie Jean King National Tennis Center.

With fans huddled in the shade of the west side awning on a 91-degree day and chanting her name, the 146th-ranked Townsend took a 4-3 lead in the third set with her solid lefty groundstrokes and slice backhands. But Wozniacki won the next three games, breaking Townsend for a 5-4 lead before serving out the 4-6, 6-3, 6-4 match.

''I could taste it, I was so close,'' said Townsend, who trains in the heat in Atlanta.

Townsend turned around a 3-1 deficit in the first set to the delight of the crowd. Wozniacki took control early in the second set for a 3-0 lead. In the third, Townsend had several ill-advised drop shots, but she won a 29-shot rally for 30-30 and the game when Wozniacki stopped play to challenge a shot she thought was out.

But the replay showed Townsend's ball was in, and she took a 4-3 lead.

''It was a confidence-builder, because I know that for someone like her, she just thrives on rallies like that,'' Townsend said of Wozniacki, who ran the 2014 New York City Marathon. ''It proves something to me, that I can hang in rallies like that.''

The heat advisory was in effect, but neither player used the allowed break. Wozniacki went to the ice towel a few times just to stay cool.

Wozniacki has slipped to No. 74 in the rankings after missing two months because of an injured ankle. She recently entered the Connecticut Open as a wild card and lost in the first round of a tournament she's won four times.

''At this point, I'm just happy when I'm healthy,'' she said. ''That's been my focus this year, to try and get back to healthy and 100 percent body-wise. It's been a struggle, but I feel like I'm there now.''

Wozniacki lives in New York part-time and has the comforts of home during the final major of the year.

''It just feels so good to be able to stay at home and cook and have chilled nights,'' she said.

Townsend, who has a 34-16 singles record, won her qualifying matches last week to get into the main field at the U.S. Open. She was ''really happy'' to play the first match on the new court.

''I didn't realize how big it was until people started to come in and it started to get a little more packed,'' Townsend said. ''People started cheering. I was in awe. It's such a beautiful stadium.''

While Townsend reached the third round of the French Open in 2014 - her best finish at a major - she's content to learn from this experience on a big stage.

''I can't really beat myself up too much,'' Townsend said. ''Moments like these where I have played and left my heart out there - and I know I could have done things better - it just drives me more to want to get out on the court and fix it, just try and do better.''