The Palace captain was denied from 12 yards by Jordan Pickford in last weekend's defeat at Everton but stepped up to put Roy Hodgson's struggling side ahead in first-half stoppage time.
Wayne Hennessey could only touch Xhaka's venomous free-kick into the top corner six minutes after the restart and the Palace goalkeeper just failed to prevent Pierre-Emerick Aubameyang from turning home his ninth of the season at the back post.
The ball was turned Aubameyang's way when Alexandre Lacazette clearly handled a right-wing corner, meaning there was a sense of justice being done when Xhaka - playing in an unfamiliar left-back role - crudely brought down Wilfried Zaha and Milivojevic denied Arsenal a 12th consecutive win.
Zaha was the familiar inspiration for Palace's promising start – cutting inside Shkodran Mustafi to drive against the base of the post before his impudent flick released Patrick van Aanholt, Andros Townsend shooting wastefully wide from the left-back's 16th-minute cross.
Arsenal settled and Hector Bellerin's hesitation in the Palace box allowed a combination of Aaron Wan-Bissaka and Mamadou Sakho to make a goal-saving block.
Mustafi's defending was not so judicious in the final minute of the half as he needlessly lunged in on Cheikhou Kouyate, leaving Milivojevic to atone for his Goodison Park woe.
The Palace skipper was culpable when Arsenal drew level, clumsily bringing down Lucas Torreira on the right-hand corner of the box for Xhaka to perform his dead-ball heroics.
Aubameyang showed supreme poaching instincts five minutes later, at which point Palace's anger was directed towards Lacazette's handball.
Palace substitute Max Meyer cracked a shot against the outside of the near post but Arsenal were holding out effectively until Zaha preyed on Xhaka's discomfort seven minutes from time.
What does it mean? Arsenal's winning run ends
Unai Emery was unable to mastermind a 12th straight win in all competitions for Arsenal, although his team again showed commendable spirit in recovering from a slow start to a match. The challenge is now to drop that habit before it does them damage when Liverpool visit Emirates Stadium next Saturday. Battling qualities were evident from both sides, with Palace deserving to avoid a fourth consecutive Premier League defeat.
Starter or sub, Aubameyang produces the goods
Aubameyang came off the bench to net braces in Arsenal's emphatic wins over Fulham and Leicester, meaning it was hard for Emery to deny the ex-Borussia Dortmund star a starting berth. He largely fed off scraps at in a frenetic encounter but showed the dead-eyed instincts that make him one of Europe's most lethal strikers on current form.
Another shocker from Mustafi
Xhaka will get his share of criticism for the challenge on Zaha but he has the mitigation of being a make-shift option at left-back. What on earth is Mustafi's excuse? From the moment he left the floor to challenge Kouyate a penalty looked like the only possible outcome.
Key Opta Facts
- Crystal Palace's opening goal from Luka Milivojevic ended a run of 417 minutes without scoring a league goal at home.
- 75% of Arsenal's Premier League goals this season have come in the second-half (18/24).
- Since the start of last season, Crystal Palace have won more penalties (13) and scored more penalties (10) in the Premier League than any other side.
- Since the start of 2016-17, Arsenal have conceded more penalties (18) and penalty goals (17) in the Premier League than any other side.
- Crystal Palace midfielder Luka Milivojevic has both taken the most (11) and scored the most (9) penalties in the Premier League since the start of 2017-18.
- All five of Granit Xhaka's Premier League goals for Arsenal have come from outside the box - only Pedro Mendes has scored more goals in the competition with all of them coming from outside the box (6).
Palace travel to Middlesbrough in the EFL Cup on Wednesday before another daunting all-London clash at Chelsea on Sunday, while Arsenal are likely to be much-changed for their next dose of cup action against Blackpool on Wednesday ahead of Liverpool's visit.