BENGALURU, June 20 (Reuters) - Indian shares opened marginally higher on Thursday, led by private sector banks after positive commentary on the sector from Macquarie, while a drop in pharma stocks capped gains.

The NSE Nifty 50 was up 0.06% at 23,531.30, while the S&P BSE Sensex added 0.17% to 77,477.91, as of 9:27 a.m. IST.

Private bank index rose 0.5% and was the top sectoral gainer by percentage.

Kotak Mahindra Bank and City Union Bank rose 2.2% each after Macquarie upgraded the two lenders to "outperform" from "neutral". Kotak was the top Nifty 50 gainer.

Analysts expected the benchmarks to trade near current levels, ahead of first-quarter results and the union budget, both due next month.

Seven of the 13 major sectors logged losses. Pharma stocks dropped 0.7%, dragged by heavyweight Sun Pharma .

The drug maker dropped about 2%, after its Dadra facility received a warning letter from the U.S. drug regulator, summarising violations concerning current manufacturing practices.

($1 = 83.4390 Indian rupees) (Reporting by Kashish Tandon and Bharath Rajeswaran in Bengaluru; Editing by Janane Venkatraman )