Knock cannot open the portal to a Magnificent Mansion.
From Magnificent Mansion:
You conjure an extradimensional dwelling in range that lasts for the duration. You choose where its one entrance is located. The entrance shimmers faintly and is 5 feet wide and 10 feet tall. You and any creature you designate when you cast the spell can enter the extradimensional dwelling as long as the portal remains open. You can open or close the portal if you are within 30 feet of it. While closed, the portal is invisible.
Let's first assume that you overcome the fact that the Mansion's portal is invisible with a See Invisibility spell (which is reasonable, since Knock and See Invisibility are of the same level).
Now, let's take a look at Knock:
Choose an object that you can see within range. The object can be a door, a box, a chest, a set of manacles, a padlock, or another object that contains a mundane or magical means that prevents access.
A target that is held shut by a mundane lock or that is stuck or barred becomes unlocked, unstuck, or unbarred. If the object has multiple locks, only one of them is unlocked.
If you choose a target that is held shut with arcane lock, that spell is suppressed for 10 minutes, during which time the target can be opened and shut normally.
When you cast the spell, a loud knock, audible from as far away as 300 feet, emanates from the target object.
Emphasis mine. Note that the effect of the Knock spell is not to open a door, but to unlock, unstick, or unbar it, allowing it to be opened normally. If you cast Knock on a locked door, the door unlocks but remains closed. If you cast Knock on a closed, unlocked door, the spell has no effect. In either case, you still need to reach out, turn the knob, and physically open the door.
The portal to the mansion is not barred, stuck, or locked with a mundane lock. Neither is it locked with an Arcane Lock spell. The Knock spell effects doors that are sealed by these means, and only these means. The portal to the Magnificent Mansion is not locked, barred, stuck, or sealed with an Arcane Lock. It is simply closed. Therefore, Knock will have no effect on it, just as Knock has no effect when cast on a door that is closed but unlocked.