Judge Grant Fraser described it as "serious offending" and handed Lim an 8-month term, while his co-defendant got 6 months.
Neither had previous convictions, which he said saved them from a sterner penalty.
Court documents show Pan worked at an Auckland cafe with a Hong Kong national Yiu Sing Hang and his girlfriend Tansi Wang, who was an illegal overstayer.
Pan introduced them to Lim in February 2013 and told them he could help.
Hang and Wang handed over $6500 in cash to the pair, after they helped complete various documents.
But Lim later told them the cost for that visa would be $20,000, as Ms Wang's application was "more difficult".
They paid - in instalments of $12,000 and $8000 - in April 2013 but Immigration New Zealand declined the application the following month.
The couple asked Lim to return the $20,000, but were told this was "not possible", according to the court documents.
They began chasing Lim to pay them back, even visiting him at Auckland International Airport where he worked. But nothing happened until they wrote a letter threatening to tell the police if Lim and Pan did not repay the money by a certain date.
The cash was refunded after a series of negotiations, but the couple pursued Lim for more money.
Hang and Wang sent another letter in August 2013 addressed to Lim, which was opened by the branch manager at the Immigration New Zealand office where he worked.
Probation reports before the court assessed the defendants as of a low risk of reoffending and Judge Fraser echoed that when sentencing Lim.
"I don't underestimate the huge consequence this offending has had on you and I guess it's a warning to others who might be tempted to engage in similar behavior that there will be a significant court response," he said.
"I'm sure we will not see you back at court ever again."
Serious Fraud Office Director, Julie Read said: "Corruption is not a way of life in New Zealand. We have a deserved reputation as one of the least corrupt countries in the world and as the lead investigative agency in relation to corruption, the SFO is committed to investigating and prosecuting offending in New Zealand in order to uphold that reputation."