Is air gap needed if dishwasher is connected directly to the sewer line?
You do need an air-gap. In my state it is legally required (Cal Plumbing Code 414.3)

Contrary to what you might mistakenly interpret from some other comments, it does not serve the same function as your sewer/drain vent system. It is not a "vent", it is a vacuum breaker.