The second part of my title is a bit misleading, my bad. I mean the other generals, such as Stonewall Jackson or Nathan Bedford Forrest, compared to Northern generals.
It might be best to start on a discussion of Lee just to clear up what we're looking at in terms of a measuring stick. OP's question presupposes that Robert E. Lee was one of, if not THE best general of the American Civil War. By "best" I assume this is a combination of factors including (1) scoreboard, or win/loss ratio, and (2) post-war tactical evaluation. For both categories, while we can get into a discussion about them, one has to understand that there are few contemporaries with whom we can compare Lee. From the Battle of the 7 Days onward, Lee wasn't commanding just a division or a corps, but an entire Army. In this way, on the southern side, we can really only compare him to Beauregard, Bragg, Albert Sydney Johnston, Joseph E. Johnston, and maybe Hood. No one else on that side commanded at the same level as Lee, really, so comparisons further down the line are somewhat moot. On the northern side, there are more comparisons, and we will get to those in a moment.
But for starters: was Lee a good general, nay, the best the Confederacy had? Most modern scholarship is still in agreement that Lee was indeed a very good general, and probably the very best the Confederacy had to offer, yes. While he wasn't perfect, and certainly made his fair share of mistakes, Lee did pretty well for himself through a combination of skill, intuition, attitude, and luck. When he had to run a defensive campaign (think Fredericksburg or the Wilderness Campaign), Lee was outstanding, and when we was on the offensive, he could also be superb (2nd Bull Run & Chancellorsville being wonderful examples). The man did have his faults, however, including a reluctance to commit his resources and energies to the western theater campaign, and his insistence on seeing a battle through despite evolving circumstances (Antietam and Gettysburg, though in the former instance, luck was on his side and it worked out for him). Lee also ran hot and cold when it came to communicating to his subordinates, and while some of them seemed to intuitively understand the vagueness of his orders and their intention (Jackson), others had difficulty (Ewell), and disastrous results followed. Except for Longstreet, though, Lee's win/loss record when comparing similar circumstances of battle is tops among the Confederate generals.
All that being said, it is hard for one to think of another General in the Confederacy except, perhaps, for Longstreet, who could have done a better job in the role. Lee knew how to get the most out of his army (both in terms of numbers and resources), and how to use them effectively regardless of the situation. He understood the political calculus of the conflict (hence his insistence on invading the north twice despite the tactical disadvantage), and managed his generals well on most occasions. When in battle, he knew how to place his men effectively, and was even better at making adjustments in the heat of battle to address breakthroughs and openings. Again, except for Longstreet, no other Confederate general demonstrated effectiveness on these levels with such consistency. What's more, Lee knew how to carry himself like a general, and understood the drama of leadership, and how one's bearing can move and influence an army. Like McClellan (whose battlefield acumen didn't come anywhere near Lee's), Lee's men truly loved him, and would do anything for him. This isn't something that can be discounted when discussing good generalship in the Civil War.
So, except perhaps for Longstreet, who seemed to be as good of a general on paper as Lee, and was just as sharp, pragmatic, and disciplined, I think it could be said that Lee was the best general the Confederacy had on their side. Joe Johnston was too timid and cautious, A.S. Johnston lost the one big battle he did fight (and died doing it), Beauregard was unrealistic, and Hood and Bragg were pretty much disasters from the word "go" in a commanding army role. As mentioned earlier, it is difficult to compare Lee with any other Confederate generals because the resumes just don't line up.
As for a comparison of Lee against northern generals, again, it is hard to compare. Lee was fighting a completely different campaign under circumstances lightyears removed from his Union counterparts (transportation and supply networks alone make this an apples v. oranges discussion). Tactically, one could make the argument that Grant, fighting a very cagey, experienced, motivated, and disciplined foe, displayed generalship on the same level as Lee during their head-to-heads of '64 and '65. Grant made several dynamic moves with his army that nearly flanked Lee on two occasions before successfully doing just that on route to Petersburg, where Grant bottled Lee up. Earlier, in 1863, Grant pulled off something just short of a miracle when he abandoned his supply lines, marched south of Vicksburg, crossed the Mississippi River, then fought to a siege that would eventually force the surrender of a massive Confederate garrison (and open the river back up to the Union). This was maybe the most impressive military feat of the entire war. Sherman's march to the sea and eventual dismantling of Hood's forces was nearly as impressive, as was the initiative showed by a young Major named Emory Upton who developed tactics during the Spotsylvania Courthouse campaign that leap-frogged military theory to where it would be in World War I.
TD:LR - In the south, yes, we can reasonably argue that Robert E. Lee was one of, if not THE best general that the Confederacy had. When comparing Lee to generals in the north, it is more difficult, but an argument can be made that Union generals accomplished feats that were on the same level as Lee.
[Sources: Bruce Catton: Army of the Potomac trilogy & 'Grant Moves South'; James McPherson, 'Battle Cry of Freedom'; Doris Kearns Goodwin, 'Team of Rivals'; Ronald C. White, 'American Ulysses']