Sensex, Nifty gain marginally; FMCG, metals, pharma support