In a matchup of returning stars, Ejim outshone McGary and led the Cyclones to one of their biggest wins under coach Fred Hoiberg.
Ejim returned after missing two games with a hyperextended knee to score a game-high 22 points and Iowa State beat No. 7 Michigan 77-70 Sunday.
Naz Long added 16 for the Cyclones (3-0), who closed the game on a 23-10 run and held McGary to just one point in the second half.
"Melvin, I can't say enough about him. I told him in my office (Saturday), `If you do get the green light, I'm going to gradually ease you back into this thing -- and I think I took him out for two minutes in the second half. Pretty big-time performance from Mel," Hoiberg said.
McGary, a preseason first-team All-American who missed two games with a lower back injury, finished with nine points, six rebounds and four steals in 22 minutes.
"It was good to be back. Trying to find the right chemistry on the court. Typical first game, trying to find the right group of guys, try to feel it out and have a good feel on the floor," McGary said.
Michigan was just 8 of 29 from 3-point range and 4 of 9 on free throws.
"We did not execute the way we had to. They changed a little bit of pressure on their defense and blew up a couple of plays and we panicked a little bit. Out of that still...we had really good shots. They just didn't go down," Michigan coach John Beilein said.
Michigan kept threatening to pull away from the Cyclones in the second half -- especially with Iowa State forward Georges Niang on the bench with four fouls.
Ejim kept the Wolverines from doing it.
Stauskas took a loose ball and flushed it home with an emphatic one-handed dunk, only to watch Ejim answer with a 3. Spike Albrecht then hit a layup, and Ejim responded with a jumper.
Iowa State's DeAndre Kane followed with a 3, and Long's 3 capped a 13-2 run that gave the Cyclones a 67-62 lead with 5:00 left.
Kane had 13 points and six assists and Dustin Hogue added 12 points and 10 rebounds.
"It was fun to be back," Ejim said. "I've been working hard throughout the offseason, getting tons of shots up and working on my game. So I expected to be a little better. But this was a great game. I was feeling it."
When McGary and Ejim entered play together with 16:17 left in the first half, no one was quite sure how healthy either one of them was.
But by the end of the half, it was clear that McGary and Ejim were the two best players on the floor.
McGary jumped a passing lane and maneuvered through Iowa State's defense for a transition layup, one of four field goals he had in the first half alone. Ejim, a preseason first-team All-Big 12 pick, gave the Cyclones a huge boost off the bench with 12 points and five boards his first 10 minutes of action.
McGary couldn't keep it up in the second half though -- while Ejim helped key Iowa State's late surge.
"He just crashed the glass hard. He's a high motor type of guy," McGary said of Ejim. "He's a great player, and he did well for them."
Ejim's return was among the many reasons why Sunday's matinee was one of the biggest non-conference games Iowa State has ever hosted.
Hilton Coliseum sold out in less than 10 minutes when tickets went on sale last month. A school-record 22 NBA scouts requested credentials as well, no doubt hoping to get a glimpse of McGary and Robinson.
The Cyclones also brought back former coach Johnny Orr, who left Michigan for the Cyclones in 1981.
Though Michigan looked to be on the verge of taking over more than once, Iowa State rallied to score a win that'll likely come in handy come March.
"This is huge for our program, for our fans to see our team winning like this. This is huge for them, to camp out all night and to see this, it's just awesome," Niang said. "I'm excited for the things that are in the future for us."
Michael Jordan joins Roy Williams, former Tar Heels in condemning systematic racism
Michael Jordan joined coach Roy Williams and other North Carolina basketball luminaries in a video posted Monday condemning systemic racism and police brutality against Black people.
The top 10 moments of Zion's career
SportsCenter counts down the top 10 moments in Zion Williamson's career, including his winning dunk at the 2018 Powerade Jam Fest in high school and 17-point fourth quarter in his NBA debut against the Spurs.
Iowa State's Rasir Bolton: Transfer from Penn State due to coach's 'noose' remark
Iowa State's Rasir Bolton says he transferred from Penn State after coach Pat Chambers told him he had a "noose" around his neck. Chambers apologized publicly and to Bolton's family Monday.