The 38-year-old, who missed Pakistan's 56-run victory in the first Test in Dubai with illness, smashed 127 to carry Pakistan, who won the toss, to 304-4 at the close at Sheikh Zayed Stadium.
Younis finally holed out to deep mid-wicket off part-timer Kraigg Brathwaite after five hours at the crease, with fading light prompting the umpires to halt the day six overs before the scheduled close.
Skipper Misbah-ul-Haq was unbeaten on 90 -- just ten runs short of his 11th hundred as Pakistan's batsmen dominated on a batting-friendly pitch.
It was again the two veteran batsmen -- Younis and Misbah -- who put Pakistan on track for another big total with their 15th hundred partnership in 49 innings.
More From This Section
Misbah, who has now equalled Imran Khan's record of most Test matches as Pakistan captain with 48, hit two sixes and four boundaries as he worked in tandem with Younis to build an imposing total.
West Indies were guilty of sloppy fielding with Younis dropped on 83 when Brathwaite failed to hold a return catch off his own bowling and wicket-keeper Shai Hope handing Misbah a lifeline on 54 off paceman Shannon Gabriel.
It was Younis's 33rd Test hundred and 11th in the United Arab Emirates -- where Pakistan have been forced to host international fixtures because of security fears back home.
He drove spinner Roston Chase for his eighth boundary to complete his hundred -- his 31st score of over 100 without being dismissed in nineties -- the most in Test cricket.
Younis and Shafiq led the eraly recovery after Pakistan lost openers Azhar Ali (nought) and Sami Aslam (six) in the first hour.
Shafiq batted well in the extended two-and-a-half hour first session due to Friday prayers, hitting seven boundaries before playing on to Gabriel.
Pakistan, who lead the three-match series 1-0 after winning the first Test in Dubai by 56 runs, brought in Younis, Zulfiqar Babar and Rahat Ali as they made three changes to their line-up. Wahab Riaz, Mohammad Amir (both rested) and Babar Azam were the trio to make way.
West Indies were forced to leave out unfit wicket-keeper batsman Shane Dowrich, bringing in Shai Hope.
The third and final Test starts in Sharjah from October 30.