Cartwright, a batting all-rounder, can also bowl medium pace. He replaces Nic Maddinson in the side after the left-hander scored just 27 runs in his four innings.
O'Keefe will replace pace bowler Jackson Bird in the only other change from the side that wrapped up the three-match series with a game to spare at the Melbourne Cricket Ground last week.
The 32-year-old edged out fellow left-arm spinner Ashton Agar, who had also been recalled to the squad, as the second slow-bowling option behind Nathan Lyon for the match at the Sydney Cricket Ground, which has typically produced slow, turning wickets.
News that makes sense
Your trusted source for staying up-to-date with the world around you. Get free daily news updates and analysis, straight to your inbox.
O'Keefe has played three previous tests, including the Sydney game last year against West Indies, but was injured on the tour of Sri Lanka earlier this year.
Australia: David Warner, Matthew Renshaw, Usman Khawaja, Steve Smith (captain), Peter Handscomb, Hilton Cartwright, Matthew Wade, Mitchell Starc, Steve O'Keefe, Josh Hazlewood, Nathan Lyon
(Reporting by Greg Stutchbury in Wellington; Editing by Larry Fine)
