It wasn't easy but Indiana will take it.
Ferrell scored Indiana's final six points all from the free throw line in the final one minute and six seconds.
"Yogi did a fantastic job,'' said IU coach Tom Crean on his postgame radio show. "He followed through on his jump shot which is something he wasn't doing as much the other day. He just did a real good job of taking what the defense was giving him.''
The win snapped a two-game losing streak for Indiana (13-7, 3-4 Big Ten) and marked the sixth loss in a row for the Illini (13-8, 2-6). The win also avenged an 83-80 overtime loss to Illinois on New Year's Eve in Champaign.
Stanford Robinson was IU's only other player in double figures with 10 points. Noah Vonleh was limited to four points but had 14 rebounds to lead the Hoosiers. As a team, the Hoosiers had a 42-28 rebounding advantage.
"I thought it was a fantastic defensive effort,'' Crean said on the radio show. "I thought in the second half we had tremendous concentration, we were switching defenses and the ball movement was really good.
"This was a big game for two desperate teams doing their best."
Indiana led by two at the break and trailed by one at 17:37 in the game after Ekey hit a 3-pointer to make it 29-28.
The Hoosiers answered with a 12-0 run to lead by 11 at 40-29. Ferrell had nine of the points in the run including a 3-pointer that provided the last points of it.
After Illinois trimmed the lead to three at 42-39, IU went on another six point surge. Vonleh hit a shot just inside the 3-point line, Robinson scored on a drive to the basket and Jeff Howard tipped in a missed Vonleh shot. That make it 48-39 with 5:55 to play.
It was the seventh consecutive Big Ten road loss for the Illini.
Follow Terry Hutchens at Twitter.com/Foxsportshutch