United have reportedly rejected a bid from rivals Chelsea for Rooney but the striker was said to be "angry and confused" by comments from new manager David Moyes that suggested he would have to be van Persie's back-up next season.
"If I was Wayne I would be very confused, too," McIlroy, a Manchester United fan, told a press conference at Muirfield, where the two-time major winner is gearing up for the start of the British Open on Thursday.
"He's had nine great seasons at Man United, and reading between the lines of what's being said, I don't think he needs to prove himself to anyone.
"I don't think he needs to prove himself to the new manager.
"I don't think he should be playing second fiddle to van Persie.
"He's been a great player and a very loyal player for Man United."
McIlroy hoped Rooney would stay at Old Trafford but said he would understand if the England star wants to move on if he doesn't start matches.
"I guess he just wants to play football.
"I think he's that sort of player.
"He just wants to get on the pitch and show what he can do. And if he doesn't feel he can do that at United, he'll obviously want to go elsewhere.
"And I think that's very understandable," the world's number two golfer said.