The shooting happened just before 11 p.m. in the Harding Woods trailer park on the 100 block of Harding Highway, police said.
According to the New Jersey Attorney General's Office, the trooper was investigating a home invasion that was reported earlier in the day before the shooting on Saturday night.
"Several subjects drove to where the trooper was conducting the investigation and a number of individuals exited their vehicles and confronted him," said the AG's office. "The trooper identified himself as law enforcement and was subsequently fired upon and wounded."
Authorities say the trooper returned fire but it's unknown if anyone was struck.
The trooper underwent surgery earlier Sunday morning after being shot in the leg. He is expected to make a full recovery.
No charges have been filed in the shooting. Anyone with information concerning the shooting is encouraged to contact (856) 451-0101.