The defending champion had to dip into his armoury of explosive winners to finally see off the British number two inside Arthur Ashe Stadium.
The last time Evans played the top-ranked player he rose to the occasion, beating Novak Djokovic in Monte Carlo three years ago.
And the 26th seed brought the very best out of the 20-year-old Wimbledon champion before succumbing 6-2 6-3 4-6 6-3.
Alcaraz dominated the first set, constantly pushing his opponent to the back of the court and hitting 14 winners to Evans' four.
But he showed he is not infallible at the start of the second after a double-fault gave Evans, who was beginning to relish the challenge, a break point which he converted with a superb backhand down the line.
Alcaraz quickly retrieved the break and a frustrated Evans was given a code violation after slicing the ball into the crowd after netting a volley at 15-30 up on the Spaniard's serve.
Evans was playing well, but Alcaraz simply raised his level and brought up set point with a blistering forehand down the line which brought gasps from the spectators.
Evans saved that one, but could do nothing with the next after an exquisite lob and simple volley put Alcaraz two sets up.
Never one to give up without a fight, Evans promptly played one of the best sets of his career.
He broke for 4-3 and, serving for the set, forced Alcaraz into some of the most outrageous clutch winners.
The pair, who played golf together at Wimbledon, frequently exchanged knowing looks and grins, such was the quality of the cat-and-mouse tennis on show.
It took Evans, 33, five set points to make the breakthrough, prompting a suddenly exasperated Alcaraz to slam his racket down in frustration.
But Alcaraz turned the match back in his favour with another stunning shot on break point. On the run and at full stretch, he unleashed a forehand down the line which clipped the baseline and left Evans stood, hands on hips, in sheer disbelief.
Two aces, another sensational lob onto the baseline and a 61st winner of the match finished Evans off, but Alcaraz knew he had been in a contest.
"He's a tricky opponent, great slices, good touch and it's my game as well so it was a pretty good match," said Alcaraz.
"We made great points, great shots, a lot of different situations, so I'm really happy to get through
"We played some great points that made us smile, Dan as well. It's great to see Dan and I on a tennis court, we tried to entertain and make the match fun."