Clear chances were at a premium in the opening period but Ryan Jack opened the scoring four minutes after the interval with a smart finish.
The second soon came from a curling effort from on-loan Liverpool midfielder Ojo - one of two debutants in the starting line-up alongside Jordan Jones.
Rangers went three ahead from a Borna Barisic free-kick with Connor Goldson making sure from the follow-up, although the original effort was well over before being clawed out by the goalkeeper.
And substitute Alfredo Morelos finished the second-half rout with a header.
Steven Gerrard's half-time team talk did the trick after the hosts had frustrated Rangers during the opening 45 minutes of the first qualifying round.
Celtic suffered a shock defeat against Lincoln Red Imps at the same Victoria Stadium in the shadow of the Rock of Gibraltar three years ago, although a new artificial pitch installed with the help of a FIFA grant in January offered a better surface.
There was an early warning for the visitors when Federico Villar was left unmarked from a deep free-kick but could not get his head on the ball.
Jack and Ojo saw long-range shots comfortably saved before Jermain Defoe stabbed wide from a tight angle and it took half an hour for Rangers to force a clear chance. Goalkeeper Francisco Mateo Vera blocked well from Ojo after a Steven Davis shot deflected into the midfielder's path.
Glen Kamara came close from 25 yards but the hosts were afforded two shooting chances from outside the box which they could not keep down and Davis sliced well wide from a decent opening with the last kick of the half.
A better chance came two minutes into the second half when Ojo got on the end of James Tavernier's inviting free-kick but the midfielder volleyed over from six yards.
The breakthrough soon came when Jack cushioned a volley into the corner of the net from 10 yards following Barisic's cross.
Ojo seized on a loose ball on the edge of the box and curled a left-footed effort inside the far post six minutes later and it was 3-0 midway through the half.
Goldson celebrated after tapping home the rebound but footage showed Barisic was the goalscorer with his 25-yard free-kick.
The goalkeeper again clawed out an effort from behind his line in the 76th minute as Morelos headed home from Tavernier's cross after shaking off a groin strain to replace Defoe.
Greg Stewart and Joe Aribo were handed debuts off the bench and the only downside of the second half for Rangers was a needless late yellow card for Ojo for a rash tackle.