One of my favourite memories of cricket involves fielding at midwicket and watching a batsman curse just about every relative our team's players had. The reason he was so upset was that the bowler was wasting time, and this gentleman was getting late for his maghrib prayers.

The maghrib prayer is the fourth of the five daily prayers offered by Muslims and is scheduled right after sunset. It marks the end of the day in the Islamic calendar, which is why important rituals, like breaking the Ramzan fast, take place at this time. Beyond the religious, maghrib also marks the time when people return home from work, when dinner preparations begin, when young children are not allowed to go outside anymore. The call for maghrib prayers also represents the moment when all cricket played on the streets must come to an end.

In a country like Pakistan the advent of maghrib is a distinctly palpable affair. The traffic increases, street lamps flicker on, older men start walking slowly to the mosque, and there is an urgency to end the galli match. The lengthening shadows and rapidly disappearing light make chasing a target at this hour nearly impossible.

Cinematographers refer to this time as the golden hour, because the sunlight gets "softer" and its hue "warmer". Cricket chases set against the impending maghrib gain an ethereal pink-orange gloom, which adds a sense of mournful beauty to the impassioned proceedings.

The ubiquity of floodlights and day-night matches means that the shorter versions of international cricket don't witness the maghrib chase anymore, and in any case, no chase in those formats can ever compare in narrative depth to a five-day match coming to an end.

As the spectacular Sharjah Test just showed, a maghrib chase can bring to a Test match the atmosphere and attitude of a galli game. As the sun sank in Sharjah on Monday, Angelo Mathews and his Sri Lankan side began to develop mysterious ailments that required the constant presence of the physios. And their field placings were deliberated upon with the intensity of a poet deciding on an adjective.

Yet the allure of a fantastical chase in cricket often seems to lie in the fact that the impossible keeps happening. As Misbah-ul-Haq and Azhar Ali entered the final hour of the fifth day, I was reminded of another famous maghrib chase. In 2001, England broke one of Test cricket's proudest records by becoming the first team to beat Pakistan in a Test match at the National Stadium in Karachi - a record that had stood for nearly 50 years. Even now, when I look at the absolute darkness surrounding the jubilant English batsmen in the pictures from that day, I can't believe that Karachi lost its record to a maghrib chase.

For a city so steeped in galli cricket culture and for a team being led by a local boy, it beggared belief that Pakistan in that game did not make use of the trade secrets any decent galli captain turns to: pushing close-in fielders for catching chances helps cloud the batsman's vision; instructing the bowlers to regularly slip in bouncers serves to undermine the batsman's confidence; and then dirty tricks like pretending your mother is calling out to you, or that your shoe has a mystery pebble in it are essential time-wasting tactics passed down from generation to generation.

But like Moin Khan back in 2001, Mathews failed in Sharjah because he had lost his nerve long before the end, playing negative rather than attritional cricket. His approach of not wanting to lose meant that his team lacked the initiative going into the climax, allowing Azhar and Misbah to firmly take charge of proceedings at that time.

That left time-wasting as the only weapon the Sri Lankan captain had, and here we witnessed one notable difference from galli cricket. Instead of a biased uncle or a bored team-mate, the Sharjah Test had professional umpires who eventually stepped in to prevent Sri Lanka's increasingly desperate (and completely justified) tactics, and it was their intervention that seemed to kill the fight.

Test cricket had only recently seen the world's best side turn away at the precipice of a historic chase, but Pakistan drove on with the sort of calmness that we're still not used to seeing, even after three years of Misbah. Like all good maghrib chasers, Pakistan bathed themselves in the warm golden hues of the fading light while their vanquished opponents were swallowed by its creeping purple shadows.

Ahmer Naqvi is a journalist, writer and teacher. He writes on cricket for various publications, and co-hosts the online cricket show Pace is Pace Yaar. He tweets here