While India is in the northern hemisphere, keep in mind that tropical locations don't usually follow typical seasonal patterns experienced at higher latitudes. Instead, the tropics often have a wet season and a dry season. The tropics do not have extreme differences in winter/summer temperatures because the amount of sunlight everyday doesn't vary too much throughout the year. This is in contrast to high latitudes that have large fluctuations in "length of the day", since the Earth is tilted.
The summer solstice is typically considered the first day of summer, but some people do consider the summer solstice (the "longest day") to be the middle of summer, where summer is from May-July. Tropical locations like India consider their hottest months to be "summer" in the local vernacular, but more accurately it would be the "pre-monsoonal" season. India would be hotter in June and July, except the monsoon season is accompanied by a shift of wind-flow direction from continental to marine. Marine air is cooler than hot continental air because the ocean absorbs and transfers a lot of heat away.
The hottest days in India are before the rainy season, because of the way the climate works there. There are several climatic zones in India, and Wikipedia actually has a pretty decent synopsis. The monsoon season is caused by:
...southeast trade winds originating from a high-pressure mass centered over the southern Indian Ocean...
These inflows ultimately result from a northward shift of the local jet stream, which itself results from rising summer temperatures over Tibet and the Indian subcontinent. The void left by the jet stream, which switches from a route just south of the Himalayas to one tracking north of Tibet, then attracts warm, humid air. The main factor behind this shift is the high summer temperature difference between Central Asia and the Indian Ocean.
More fun facts from the same wiki page:
The nation's climate is strongly influenced by the Himalayas and the Thar Desert. The Himalayas, along with the Hindu Kush mountains in Pakistan, prevent cold Central Asian katabatic winds from blowing in, keeping the bulk of the Indian subcontinent warmer than most locations at similar latitudes. Simultaneously, the Thar Desert plays a role in attracting moisture-laden southwest summer monsoon winds that, between June and October, provide the majority of India's rainfall.
Also see the diagram below from this UCAR page, which discusses seasonal difference of monsoons in that region.
