The pair added 218 runs for the fourth wicket as Pakistan reached 327 for four at the close of play on the second day with a lead of 123.
Younis (136) dominated the partnership and the hapless Sri Lankan bowlers to complete his 23rd Test hundred with a cover-driven four off left-arm spinner Rangana Herath.
The stylish right-hander, 36, hit 19 fours and a six before being bowled by paceman Shaminda Eranga.
Captain Misbah went into a shell as he neared his fifth Test hundred but reached the mark in 241 deliveries with a single off Sachithra Senanayake.
The 39-year-old was unbeaten on 105, including 13 fours, at stumps. Asad Shafiq (12) was the other not out batsman at the crease.
Resuming on 46 for one wicket, Pakistan lost Mohammad Hafeez (11) early when the right-hander was caught by a diving Kaushal Silva at short cover off paceman Suranga Lakmal.
Eranga then forced debutant Ahmed Shehzad (38) to miscue a pull shot straight to Dimuth Karunaratne at square leg to reduce Pakistan to 83 for three.
But Sri Lanka were denied any further success till late in the final session as both the faster bowlers and the spinners struggled to extract anything from the docile wicket.
Herath and off-spinner Senanayake bowled 49 overs between them out of the 109 in the innings but rarely troubled the Pakistan batsmen.
Scorecard
Sri Lanka 1st innings 204
Pakistan 1st innings (overnight 46-1)
Khurram Manzoor run out 21
Ahmed Shehzad c Karunaratne b Eranga 38
Mohammad Hafeez c Silva b Lakmal 11
Younis Khan b Eranga 136
Misbah-ul-Haq batting 105
Asad Shafiq batting 12
Extras: (lb-1, nb-2, w-1) 4
Total: (four wkts; 109 overs) 327
Fall of wickets: 1-46, 2-59, 3-83, 4-301
Bowling: Lakmal 27-7-84-1, Mathews 9-0-36-0, Eranga 24-5-63-2, Herath 31-9-77-0, Senanayake 18-2-66-0.
Image: Younis Khan
Photograph: Gareth Copley/Getty Images
Sri Lanka recall Jayawardene, Herath for Pakistan Tests
Pakistan's Junaid, Bhatti restrict Sri Lanka to 204
Hafeez returns to Pakistan squad for Sri Lanka Tests
Kohli retains number sixth position in ODI rankings
Wanderers Test: Faf du Plessis master of 4th innings chases