Sodhi grabbed 6-86 and threatened to give New Zealand victory in the first two sessions on the fifth and final day, but Pakistan fought on before declaring their second innings on 311-8.
That gave New Zealand a tough target of 138 to win in 15 overs, and the chase ended in fading light on 61-1, with Tom Latham unbeaten on 35 and Devon Conway 18.
Michael Bracewell was the only wicket to fall for three.
Sodhi was the star as he improved on his previous best of 4-60 against Zimbabwe in Bulawayo four years ago.
The 30-year-old, playing his first Test in four years, turned the match in New Zealand’s favour with three wickets in the second session to leave Pakistan on 249-7 at tea with 35 overs left in the match.
But Saud Shakeel, who ended with 55 not out, and Mohammad Wasim (43) defied for 75 minutes and 111 balls during their 71-run eighth wicket stand to deprive New Zealand of a win.
Soon after tea, Sodhi trapped Wasim leg-before, but Mir Hamza (three not out) assisted Shakeel in a ninth-wicket unbroken stand of 34 runs in 50 minutes to further frustrate the visitors.
Shakeel, who hit seven boundaries and a six, built on after fighting knocks from Imam-ul-Haq (96) and Sarfaraz Ahmed (53) in the first two sessions.
In the post-lunch session, Sodhi dismissed Sarfaraz, Agha Salman (six) and Haq in the space of 27 balls for the addition of just 21 runs.
Haq and Sarfaraz had added a defiant 85 runs for the fifth wicket and raised hopes of salvaging a draw for the home team before Sodhi struck.
He had Sarfaraz caught behind, bowled Salman, then got Haq stumped to leave Pakistan on 206-7.
Haq, who survived lbw referrals off the bowler on 58 and 74, cracked 10 boundaries and a six in his sixth half-century, while Sarfaraz had seven hits to the rope.
So incensed was he by his dismissal, Haq smashed a chair with his bat on the way to the dressing room.
Resuming on 77-2, Pakistan lost nightwatchman Nauman Ali early, trapped leg-before by spinner Bracewell.
Then skipper Babar Azam — who scored 161 in Pakistan’s first innings of 438 — was out the same way to Sodhi for 14.
The second Test starts at the same venue on Monday.