A small number were left outside as goals from Krystian Nowak, Don Cowie and a double from Jamie Walker, with a reply from Emerson Hyndman, ensured victory for Hearts.
The Tynecastle club have since investigated the incident and found that several away fans gained non-permitted access to the stadium.
Once the official crowd count reached capacity, Hearts were left with no option but to close off access to the Rangers section in the Roseburn Stand.
They have since apologised and offered a refund for those affected.
Hearts said in a statement: “As part of the normal match operation at every game, the club monitors ticket sales and ticket entry for every stand at Tynecastle. Just at kick-off on Wednesday, the Rangers section of the Roseburn Stand reached its capacity.
“The number of tickets sold – 1478, reflected the computerised count – 1478 and at that stage, the club had no option but to close the turnstiles in the interests of crowd safety and in accordance with our licence. This unfortunately led to a very small number of Rangers fans, who held valid tickets, to be refused entry into the stadium for the game.
“Following a club investigation, it is now clear to us that a number of people gained entry into the Rangers end without valid tickets and this created the situation where a small number of fans were then unable to gain admittance.
“We apologise to the Rangers fans who found themselves in this very unfortunate situation and we will work closely with Rangers to refund the cost of their match tickets and any associated fees.”