McGhee hit two free throws with 1:14 remaining, snapping a run of seven straight points by Purdue and giving the Hoosiers (11-15, 2-11 Big Ten) a 60-59 lead. A basket by KK Houser put the Boilermakers back on top 61-60 with 13 seconds left before Indiana called timeout and got the ball to McGhee, whose jumper sealed the victory and snapped a 10-game losing streak for the Hoosiers.
Aulani Sinclair added 16 points and Sasha Chaplin had 10 for Indiana.
Purdue (19-7, 8-5) has dropped two straight after falling to Iowa 72-52 on Sunday, and lost to Indiana for the first time since 2009—a span of eight games.
Taylor Manuel had 16 points for the Boilermakers, Houser had 12 and Drey Mingo added 11 points and 10 rebounds.